how to find highest intesity value point from a given matrix
3 次查看(过去 30 天)
显示 更早的评论
suppose there is a matrix like below
122.9672 121.5649 120.2468 118.7600 117.2035 115.6017 113.8413 111.7508 122.9196 121.5226 120.1134 118.6164 117.0462 115.4400 113.6867 111.6543 122.6745 121.3784 119.9041 118.3545 116.9730 115.3530 113.5398 111.5243 122.4921 121.0867 119.5630 118.3065 116.9100 115.2058 113.3887 111.3885 122.1304 120.6768 119.5626 118.2678 116.7932 115.0587 113.2190 111.0841 121.9399 120.7792 119.4907 118.0365 116.5525 114.8477 113.0947 110.9844 121.9365 120.7018 119.2644 117.7673 116.2963 114.7126 112.9527 110.8958 121.7612 120.4922 118.9793 117.4990 116.0592 114.3961 112.6046 110.6259 121.3596 120.0059 118.4950 117.0195 115.6654 114.0556 112.5314 110.5393 120.9674 119.6306 118.1054 116.6869 115.3388
can anyone help me how to find the highest intensity value point from the above matrix
0 个评论
采纳的回答
Paulo Silva
2011-3-28
%supposing a is your matrix
[value, index]=max(max(a))
1 个评论
Jan
2011-3-29
But then [index] is the column index only and the row-index is lost.
"[value, index] = max(a(:))" would reply at least the linear index.
更多回答(1 个)
Jan
2011-3-28
The most accurate answer to your question is: "122.9672" at (1,1). But your "matrix" has no rectangular shape.
And explicitely again:
A = rand(10, 10); % Example data.
[rowValue, rowIndex] = max(A, 1);
[Value, col] = max(rowValue);
row = rowIndex(col);
Or:
[maxNum, maxIndex] = max(data(:));
[row, col] = ind2sub(size(data), maxIndex);
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Linear Algebra 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!