Finding maximum value of a column in a matrix
51 ビュー (過去 30 日間)
古いコメントを表示
Hello, I would really appreciate any help I can get here. I have a 3x5 matrix, A= [4 9 7 8 8; 2 1 0 3 5; 6 3 3 2 1]. I want to find the maximum value in column 1 and have the output display the corresponding row values of that maximum value. That is B = [6 3 3 2 1]. Please how can I achieve that? Thank you.
0 件のコメント
採用された回答
James Tursa
2017 年 6 月 26 日
[~,x] = max(A(:,1));
B = A(x,:);
4 件のコメント
raqib Iqbal
2020 年 7 月 3 日
How to run this in a loop like after finding max value of column1 ,it will display and den find the next max value from that same column1?
その他の回答 (0 件)
参考
カテゴリ
Help Center および 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!