help how can I find the minimum number and return it's index in each row?
古いコメントを表示
help how can I find the minimum number and return it's index in each row?
採用された回答
その他の回答 (1 件)
Guillaume
2014 年 11 月 13 日
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);
カテゴリ
ヘルプ センター および File Exchange で Creating and Concatenating Matrices についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!