how can i delete the extracted rows from the original matrix ?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
MAHMOUD ALZIOUD
am 22 Nov. 2017
Kommentiert: MAHMOUD ALZIOUD
am 27 Nov. 2017
Dear All, I have an original matrix called M that is 1000*15, I extracted a matrix from it based on a condition and is called Tand, Tand is 400*15, now how can i delete the extraced rows from the original matrix? i wrote this but it didnt work, because the size of M is still 1000*15 instead of 600*15 !! please help
Tand= M(M(:,15)<6, :); % this is the extracted one with 400*15 dimension.
M(Tand, :)= []; %this is to delete all the rows from M that belongs to Tand.
%where is the problem?
0 Kommentare
Akzeptierte Antwort
James Tursa
am 22 Nov. 2017
x = M(:,15)<6; % Remember the logical indexes of the rows
Tand= M(x, :); % this is the extracted one with 400*15 dimension.
M(x, :)= []; %this is to delete all the rows from M that belongs to Tand.
4 Kommentare
James Tursa
am 27 Nov. 2017
Can you show a short code snippet of what you are trying to do with the files?
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Multidimensional 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!