Find rows with maximum number and replace them with 1
11 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Maryam Hamrahi
le 8 Août 2016
Commenté : Maryam Hamrahi
le 8 Août 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 commentaires
Réponse acceptée
Plus de réponses (2)
Voir également
Catégories
En savoir plus sur Annotations dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!