Compare and replace elements in a matrix
古いコメントを表示
I have a matrix say A=[1 2 3 4 5 6 7 8 9 10] B=[2 5 10]. I want to compare A and B so that 2,5 and 10 (in B) should be replaced with zeros in A. The result should be [1 0 3 4 0 6 7 8 9 0].
採用された回答
その他の回答 (1 件)
Walter Roberson
2013 年 12 月 26 日
0 投票
Have a look at ismember()
カテゴリ
ヘルプ センター および File Exchange で Cell Arrays についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!