Delete rows in a matrix based on their first number in the row.

1 回表示 (過去 30 日間)
Patrick Guarente
Patrick Guarente 2017 年 9 月 1 日
編集済み: the cyclist 2017 年 9 月 2 日
I have two matrices.
Del= [12 3 5; 15 2 7; 20 4 9; 10 2 1]
Close= [15 ; 10; 20]
I need to get rid of the Del rows that start with the values in Close. In this situation I would need to get ride of rows 2, 3, 4
Thank you

回答 (1 件)

the cyclist
the cyclist 2017 年 9 月 1 日
Del(ismember(Del(:,1),Close),:) = [];
  2 件のコメント
Patrick Guarente
Patrick Guarente 2017 年 9 月 2 日
Thank you so much
the cyclist
the cyclist 2017 年 9 月 2 日
編集済み: the cyclist 2017 年 9 月 2 日
The best form of thanks is to vote for and/or accept answers that are helpful. This rewards the contributor, and points future users to useful answers.

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

カテゴリ

Help Center および File ExchangeMATLAB についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by