help how can I find the minimum number and return it's index in each row?
Ältere Kommentare anzeigen
help how can I find the minimum number and return it's index in each row?
1 Kommentar
maha ismail
am 13 Nov. 2014
Akzeptierte Antwort
Weitere Antworten (1)
Guillaume
am 13 Nov. 2014
To find the minimum of a row, use:
min(m, [], 2)
Probably, the simplest way to ignore 0s is to replace them with NaNs before calling min.
m(m == 0) = nan;
[mval, mcol] = min(m, [], 2);
1 Kommentar
maha ismail
am 13 Nov. 2014
Kategorien
Mehr zu Creating and Concatenating Matrices 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!