Find rows with maximum number and replace them with 1
9 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Maryam Hamrahi
il 8 Ago 2016
Commentato: Maryam Hamrahi
il 8 Ago 2016
I have a matrix with n rows and 1 column. I would like to find row which have the maximum number. Then, replace 1 in these rows and replace 0 in other rows.
For instance: I have matrix A and I would like to produce matrix B.
A=
5
0
0
4
3
0
B=
0
1
1
0
0
1
0 Commenti
Risposta accettata
Più risposte (2)
Vedere anche
Categorie
Scopri di più su Annotations in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!