Remove some numbers from an array and replace them with zero?
Mostra commenti meno recenti
Lets say the array is like this:
A = [4 4 4 4 6 6 6 6 6 6 2 2 3 3 3 5 5 5 5 5 3 3 3];
How could I change the matrix to be like this:
B = [4 0 0 0 6 0 0 0 0 0 2 0 3 0 0 5 0 0 0 0 3 0 0];
I want to represent each new number in the array but not more than once. The numbers may occure several times as number three in this example.
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Image Arithmetic in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!