필터 지우기
필터 지우기

Assigning numbers to 3d matrix.

조회 수: 2 (최근 30일)
fyza affandi
fyza affandi 2018년 11월 25일
댓글: fyza affandi 2018년 11월 25일
How can I assign numbers the following matrices?
table (:,:,1) =
1 6 11
2 7 12
3 8 13
4 9 14
5 10 15
table (:,:,2)=
16 21 26
17 22 27
18 23 28
19 24 29
20 25 30
  댓글 수: 2
Stephen23
Stephen23 2018년 11월 25일
Do NOT use table as a variable name, because table is the name of an important inbuilt function.
fyza affandi
fyza affandi 2018년 11월 25일
noted. Thank you very much

댓글을 달려면 로그인하십시오.

채택된 답변

Stephen23
Stephen23 2018년 11월 25일
편집: Stephen23 2018년 11월 25일
t = reshape(1:30,5,3,2)
or
t = nan(5,3,2);
t(:) = 1:30
or
t = [1;2;3;4;5]+[0,5,10]+reshape([0,15],1,1,[])
  댓글 수: 3
Stephen23
Stephen23 2018년 11월 25일
"How to refer the last number in t(:,:,1) & t(:,:,2)?"
It is not clear exactly which number you mean, but perhaps these do what you want:
t(end,end,1)
t(end,end,2)
t(end,end,:)
fyza affandi
fyza affandi 2018년 11월 25일
Thank you

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Matrices and Arrays에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by