Filter löschen
Filter löschen

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

2 Ansichten (letzte 30 Tage)
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 Kommentare
Mudasser Seraj
Mudasser Seraj am 9 Mai 2018
Bearbeitet: Mudasser Seraj am 9 Mai 2018
what do you mean by pane? I don't know the first dimension of the matrix.
Jan
Jan am 10 Mai 2018
Please give a short example. It is impossible to guess, which operation you want.

Melden Sie sich an, um zu kommentieren.

Antworten (1)

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

Kategorien

Mehr zu Matrices and Arrays finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by