필터 지우기
필터 지우기

min value calling

조회 수: 2 (최근 30일)
Will
Will 2011년 10월 31일
I have this matrix,
A = [0.1 0.2 0.3 ;
0.4 0.5 0.6 ;
0.7 0.8 0.9];
I want to find min(A,[],1), but them I want it to tell me the row and column that the min value falls on. Any ideas?
  댓글 수: 1
Will
Will 2011년 10월 31일
PS, the values are arbitrary. I was just using that as an example. I now realize that it's a terrible example for this problem.

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

채택된 답변

Andrei Bobrov
Andrei Bobrov 2011년 10월 31일
[v,idx] = min(A,[],1)
out = [v;idx;1:size(A,2)]
or
absolute min
[v,I] = min(A(:));
[ir,jc] = ind2sub(size(A),I);
out = [v,ir,jc];

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Data Distribution Plots에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by