How to exclude specific values from a vector?

136 ビュー (過去 30 日間)
Louis
Louis 2013 年 6 月 10 日
コメント済み: Mehri Mehrnia 2021 年 8 月 17 日
I have two arrays of unmatching sizes.
For example: A=[1;2;3;4;5;7;14;76;89] B=[2;3;14]
What I would like as an output is a new vector which has all the values from A excluding values from B. So C=[1;4;5;7;76;89] I am unable to overcome unmatching dimension issues with my basic matlab skills :(
Any help would be really appreciated!

採用された回答

Iain
Iain 2013 年 6 月 10 日
C = setdiff(A,B);
  1 件のコメント
Mehri Mehrnia
Mehri Mehrnia 2021 年 8 月 17 日
really helpful,tnx

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

その他の回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by