to find position of min value

i have sm array, i calculate minimum value of this array, now i want to know, the position of this minimum value in existing array. pls help

 Réponse acceptée

Andrei Bobrov
Andrei Bobrov le 9 Sep 2013

1 vote

A - your array;
[v1,ii] = min(A);
[v2,jj] = min(v1);
out = [v2,ii(jj),jj];
or
[v3,ij] = min(A(:));
[i1,j1] = ind2sub(size(A),ij);
out = [v3,i1,j1];

Plus de réponses (1)

Walter Roberson
Walter Roberson le 9 Sep 2013
Modifié(e) : Jan le 9 Sep 2013

1 vote

@Parul: Read the documentation for min()

1 commentaire

Jan
Jan le 9 Sep 2013
Searching in the forum would reveal several similar discussions also.

Connectez-vous pour commenter.

Community Treasure Hunt

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

Start Hunting!

Translated by