Only 1st layer of a 3D Matrix.

24 ビュー (過去 30 日間)
Nicholas Deosaran
Nicholas Deosaran 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 Center および File ExchangeMultidimensional Arrays についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by