How to do set subtraction
62 ビュー (過去 30 日間)
古いコメントを表示
I have two array a=[1,2,3] and b=[2,3,4,5]
I need a array c=b\a. Here \ is the set subtract operation. result is as follows:
i.e.c=[4,5]
How to do that in matlab. Thanks in advance.
0 件のコメント
採用された回答
その他の回答 (1 件)
Vishal Rane
2012 年 12 月 12 日
Use
c = b(~ismember(b,a))
although there might be more simpler way to do this.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Environment and Settings についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!