フィルターのクリア

how can i delete the extracted rows from the original matrix ?

1 回表示 (過去 30 日間)
MAHMOUD ALZIOUD
MAHMOUD ALZIOUD 2017 年 11 月 22 日
コメント済み: MAHMOUD ALZIOUD 2017 年 11 月 27 日
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?

採用された回答

James Tursa
James Tursa 2017 年 11 月 22 日
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 件のコメント
James Tursa
James Tursa 2017 年 11 月 27 日
Can you show a short code snippet of what you are trying to do with the files?
MAHMOUD ALZIOUD
MAHMOUD ALZIOUD 2017 年 11 月 27 日
Mr James I just solved it based on your advice, it was amazing because I forgot about the logic of the condition, thank you very much for your help.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

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