Compare and replace elements in a matrix
Ältere Kommentare anzeigen
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].
Akzeptierte Antwort
Weitere Antworten (1)
Walter Roberson
am 26 Dez. 2013
0 Stimmen
Have a look at ismember()
Kategorien
Mehr zu Cell Arrays finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!