how to find highest intesity value point from a given matrix

조회 수: 3 (최근 30일)
yagnesh
yagnesh 2011년 3월 28일
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

채택된 답변

Paulo Silva
Paulo Silva 2011년 3월 28일
%supposing a is your matrix
[value, index]=max(max(a))
  댓글 수: 1
Jan
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
Jan 2011년 3월 28일
The most accurate answer to your question is: "122.9672" at (1,1). But your "matrix" has no rectangular shape.
A more general answer can be found here: Answers: finding-the-row-and-column-number-in-a-matrix
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);
  댓글 수: 1
yagnesh
yagnesh 2011년 3월 31일
yes i know its shape is not perfect..
it was just an example for being consideration
anyways thanks a lot man

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Resizing and Reshaping Matrices에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by