Only 1st layer of a 3D Matrix.
조회 수: 19 (최근 30일)
이전 댓글 표시
Nicholas Deosaran
2020년 9월 4일
댓글: Asad (Mehrzad) Khoddam
2020년 9월 4일
I have this code and I am having issues trying to figure out how to just display the 1st layer with it's own variable.
Also another variable that displays the absolute central colum.
Thank you.
A = ones(5,5,3).*reshape(1:3,1,1,3)
댓글 수: 0
채택된 답변
Asad (Mehrzad) Khoddam
2020년 9월 4일
For layer 1:
A(:,:,1)
For layer i:
A(:,:,i)
For the central column:
A(3,3,:)
댓글 수: 5
Asad (Mehrzad) Khoddam
2020년 9월 4일
This command:
A(3,3,:) = 1;
fills the central column with 1
추가 답변 (1개)
Walter Roberson
2020년 9월 4일
ItsOwnVariable = A(:,:,1);
AnotherVariable = squeeze(abs(A(:,round(end/2),:)); %absolute, central ?
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Multidimensional Arrays에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!