Effacer les filtres
Effacer les filtres

To refer index of the first number in every column in 3d matrices

1 vue (au cours des 30 derniers jours)
fyza affandi
fyza affandi le 25 Nov 2018
Modifié(e) : Stephen23 le 25 Nov 2018
t (:,:,1) =
1 6 11
2 7 12
3 8 13
4 9 14
5 10 15
t (:,:,2)=
16 21 26
17 22 27
18 23 28
19 24 29
20 25 30
How can I refer number 1, 6, 11 in t(:,:,1) and number 16,21,26 in t(:,:,2)?
t(end) is equal to 30.
How about 15 in t(:,:,1)?

Réponse acceptée

Stephen23
Stephen23 le 25 Nov 2018
Modifié(e) : Stephen23 le 25 Nov 2018
Your question is not clear because you ask for "the first number in every column", i.e.:
t(1,:,1)
t(1,:,2)
t(1,:,:) %both
But your example "How about 15" asks about the last number in the column, i.e.:
t(end,:,1)
t(end,:,2)
t(end,:,:) % both
For 15 specifically:
t(end,end,1)

Plus de réponses (0)

Catégories

En savoir plus sur Matrix Indexing dans Help Center et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by