Find rows with maximum number and replace them with 1
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Maryam Hamrahi
am 8 Aug. 2016
Kommentiert: Maryam Hamrahi
am 8 Aug. 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 Kommentare
Akzeptierte Antwort
Weitere Antworten (2)
Siehe auch
Kategorien
Mehr zu Logical finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!