omit rows from matrix

1 回表示 (過去 30 日間)
NA
NA 2018 年 11 月 24 日
編集済み: madhan ravi 2018 年 11 月 24 日
A=[1,2;1,3;1,4;1,5;2,4;2,3;2,5]
B=[2,4]
I want to omit B from matrix A
answer
A=[1,2;1,3;1,4;1,5;2,3;2,5]

採用された回答

madhan ravi
madhan ravi 2018 年 11 月 24 日
編集済み: madhan ravi 2018 年 11 月 24 日
>> A=[1,2;1,3;1,4;1,5;2,4;2,3;2,5];
B=[2,4];
idx=ismember(A,B,'rows');
A = A(~idx,:)
A =
1 2
1 3
1 4
1 5
2 3
2 5
>>

その他の回答 (0 件)

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by