필터 지우기
필터 지우기

How to know the location of the minimun value from a vector?

조회 수: 2 (최근 30일)
Isti
Isti 2012년 5월 6일
I have a vector like this: A =
0.2008 0.2011 0.2011 0.1979 0.2003
then the minimun value is: 0.1979 which located on (1,4)
So I want to take the location of that value like above. What to do? Thanks before :')

채택된 답변

Andrei Bobrov
Andrei Bobrov 2012년 5월 6일
A = [0.2008 0.2011 0.2011 0.1979 0.2003]
[c,idx] = min(A)
for matrix
eg:
A = rand(8);
solution:
[vc,irows] = min(A);
[v,icols] = min(vc);
out = [v irows(icols) icols];
or:
v = min(A(:));
[irows,icols] = find(A == v);
or:
[v,ii] = min(A(:));
[irows,icols] = ind2sub(size(A),ii);

추가 답변 (1개)

zhenqiang
zhenqiang 2012년 5월 6일
good learning

카테고리

Help CenterFile Exchange에서 Digital Filter Analysis에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by