필터 지우기
필터 지우기

Converting 2-d[:,45] matrix to 3-d[:,45,246] matrix based on unique values in 2nd column of 2d matrix

조회 수: 2 (최근 30일)
I have a 2-d matrix with [:, 45] dimension, which I want to convert into a 3-d matrix of dimension [:,45,246] based on 246 unique values on 2nd column of 2-d matrix.
  댓글 수: 3
Mudasser Seraj
Mudasser Seraj 2018년 5월 9일
편집: Mudasser Seraj 2018년 5월 9일
what do you mean by pane? I don't know the first dimension of the matrix.
Jan
Jan 2018년 5월 10일
Please give a short example. It is impossible to guess, which operation you want.

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

답변 (1개)

Walter Roberson
Walter Roberson 2018년 5월 10일
[uniquevals, ~, idx] = unique(YourMatrix(:,2));
for J = 1 : length(YourMatrix,1)
NewMatrix(J, :, idx(J)) = YourMatrix(J, :);
end

카테고리

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