to find position of min value

2 次查看(过去 30 天)
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

采纳的回答

Andrei Bobrov
Andrei Bobrov 2013-9-9
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];

更多回答(1 个)

Walter Roberson
Walter Roberson 2013-9-9
编辑:Jan 2013-9-9
@Parul: Read the documentation for min()
  1 个评论
Jan
Jan 2013-9-9
Searching in the forum would reveal several similar discussions also.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Structures 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by