I have an array R3. I need to eliminate those elements of R3 which are present in another, smaller array. Is there an easy method to do this?

1 件のコメント

Stephen23
Stephen23 2018 年 1 月 4 日
編集済み: Stephen23 2018 年 1 月 4 日
"Is there an easy method to do this?"

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

 採用された回答

Jan
Jan 2018 年 1 月 4 日
編集済み: Jan 2018 年 1 月 4 日

1 投票

setdiff replies all elements of a vector, which do not appear in a second one:
R3 = setdiff(R3, smallerArray);
Or
R3 = R3(~ismember(R3, smallerArray))

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeOperators and Elementary Operations についてさらに検索

質問済み:

2018 年 1 月 4 日

編集済み:

2018 年 1 月 4 日

Community Treasure Hunt

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

Start Hunting!

Translated by