difference of two vector
3 ビュー (過去 30 日間)
古いコメントを表示
Hi everybody, I would like to know how to solve the following problem.
A=[0 0 1 1]
B=[0]
where B has got only one component. ex. My goal is to delete the components A(1 2) automatically and obtaining
C=[1 1].
The 'A' vector is obtained afther for loop,but I don't know how many components are zero and one, while 'B' is known. My goal is to delete the components A(1 2) automatically and obtaining C=[1 1].
Thank you.
0 件のコメント
採用された回答
Star Strider
2017 年 5 月 30 日
One approach:
A=[0 0 1 1];
B=[0];
ia = ismember(A,B);
C = A(~ia)
C =
1 1
2 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Develop Apps Using App Designer についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!