Magnitude, row and column in a Matrix
5 ビュー (過去 30 日間)
古いコメントを表示
Ricardo Gutierrez
2020 年 1 月 22 日
コメント済み: Ricardo Gutierrez
2020 年 1 月 23 日
Good Morning.
I have a matrix A
A = [87.97 87.97 17.97
95.22 87.96 91.26
75.50 75.50 75.50
78.13 64.89 78.90];
What instructions should I do to get
Minimum value per column
The line and column of that value
The result would be:
magnitude 75.50 64.89 17.97
row 3 4 1
column 1 2 3
Greetings and thanks
0 件のコメント
採用された回答
Star Strider
2020 年 1 月 22 日
Try this:
A = [87.97 87.97 17.97
95.22 87.96 91.26
75.50 75.50 75.50
78.13 64.89 78.90];
[MaxA,MaxRow] = max(A)
[MinA,MinRow] = min(A)
producing:
MaxA =
95.2200 87.9700 91.2600
MaxRow =
2 1 2
MinA =
75.5000 64.8900 17.9700
MinRow =
3 4 1
6 件のコメント
その他の回答 (1 件)
Walter Roberson
2020 年 1 月 22 日
Use the two output form of min(). The second output will be the appropriate row numbers.
3 件のコメント
参考
カテゴリ
Help Center および File Exchange で Matrix Indexing についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!