Info
この質問は閉じられています。 編集または回答するには再度開いてください。
Hi I have m by n matrix,I want to find the index of the max. of each column.It can be found by [i j]:max(x,[],2).this gives the index of max of each column in vector i.I want if there is a repetion in vector i to be reset to 0.thanks
1 回表示 (過去 30 日間)
古いコメントを表示
Hi I have m by n matrix,I want to find the index of the max. of each column.It can be found by [i j]:max(x,[],2).this gives the index of max of each column in vector i.I want if there is a repetion in vector i to be reset to 0.thanks
0 件のコメント
回答 (1 件)
Azzi Abdelmalek
2013 年 11 月 11 日
編集済み: Azzi Abdelmalek
2013 年 11 月 11 日
m=[1 2 3;0 5 6;2 1 7;0 4 9]
[ii,jj]=max(m)
%[ii ji]=max(x,[],2) gives the max of each row
6 件のコメント
Azzi Abdelmalek
2013 年 11 月 11 日
No, you are looking for the max of each row, to find the maximum of each column
[ii ,jj]=max(r)
%or
[ii, jj]=max(r,[],1)
この質問は閉じられています。
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!