필터 지우기
필터 지우기

Making a 3d array with an index that unifies all three layers

조회 수: 4 (최근 30일)
Rich Cavanaugh
Rich Cavanaugh 2018년 3월 24일
댓글: Rich Cavanaugh 2018년 3월 24일
I am trying to make a 3d array what has one unified index, the first layer of the matrix will just be a number index, the second layer will be a 1 or a 0 (predefined when the matrix is generated) the third layer will be a random character.
so basically I am trying to figure out how to get an index that lets me reference all three pieces of info in one place.
Thanks in advance for any advice or direction.

채택된 답변

James Tursa
James Tursa 2018년 3월 24일
편집: James Tursa 2018년 3월 24일
x = your 3d array
k = your index
result = x(k,k,:); % the three pieces of info at index k
or, depending on how you want to use this downstream
result = squeeze(x(k,k,:)); % the three pieces of info at index k

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Matrix Indexing에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by