필터 지우기
필터 지우기

Only 1st layer of a 3D Matrix.

조회 수: 19 (최근 30일)
Nicholas Deosaran
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)

채택된 답변

Asad (Mehrzad) Khoddam
Asad (Mehrzad) Khoddam 2020년 9월 4일
For layer 1:
A(:,:,1)
For layer i:
A(:,:,i)
For the central column:
A(3,3,:)
  댓글 수: 5
Nicholas Deosaran
Nicholas Deosaran 2020년 9월 4일
Any idea on how to do it ?
Asad (Mehrzad) Khoddam
Asad (Mehrzad) Khoddam 2020년 9월 4일
This command:
A(3,3,:) = 1;
fills the central column with 1

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

추가 답변 (1개)

Walter Roberson
Walter Roberson 2020년 9월 4일
ItsOwnVariable = A(:,:,1);
AnotherVariable = squeeze(abs(A(:,round(end/2),:)); %absolute, central ?

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by