to find position of min value
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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
0 Kommentare
Akzeptierte Antwort
Andrei Bobrov
am 9 Sep. 2013
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];
0 Kommentare
Weitere Antworten (1)
Walter Roberson
am 9 Sep. 2013
Bearbeitet: Jan
am 9 Sep. 2013
@Parul: Read the documentation for min()
1 Kommentar
Siehe auch
Kategorien
Mehr zu Structures finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!