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

1 view (last 30 days)
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)?

Accepted Answer

Stephen23
Stephen23 on 25 Nov 2018
Edited: Stephen23 on 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)

More Answers (0)

Categories

Find more on Creating and Concatenating Matrices in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!