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

3d matricesindexmatricesmatrix

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)?

Best Answer

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)