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

1 visualización (últimos 30 días)
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)?

Respuesta aceptada

Stephen23
Stephen23 el 25 de Nov. de 2018
Editada: Stephen23 el 25 de Nov. de 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)

Más respuestas (0)

Categorías

Más información sobre Creating and Concatenating Matrices en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by