[英]How to get MATLAB to display the index of the minimum value in a 2D array?
[英]How to get MATLAB to display the row index of the minimum value in every column of a matrix?
我有這樣的矩陣:
S =
2.2100 16.0100
0.0100 9.8100
9.4100 0.0100
現在,我想知道每列中最小值的行數。 我正在尋找的向量應如下所示:
D =
2
3
謝謝您的幫助。
[val, ind] = min (S)
您將擁有以下價值:
val =
0.010000 0.010000
ind =
2 3
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.