substract array elements based on other arrays

1 回表示 (過去 30 日間)
Mo H
Mo H 2020 年 4 月 12 日
コメント済み: Mo H 2020 年 4 月 12 日
Hi,
I have three arrays.
The first one contain all numbrs that need to be studied, All = [1,2,3,4,5,6,7,8,9,10]
The other arrays contains the numbers that need to be retained, R1 = [8,9,10], R2 = [5]
I want the result to be (All - R1 - R2) which is equal to [1,2,3,4,6,7].
Your help is highly appreicated

採用された回答

Torsten
Torsten 2020 年 4 月 12 日
setdiff(All,union(R1,R2))
  1 件のコメント
Mo H
Mo H 2020 年 4 月 12 日
Thank you

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

その他の回答 (0 件)

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by