Borrar filtros
Borrar filtros

to find position of min value

1 visualización (últimos 30 días)
Parul
Parul el 9 de Sept. de 2013
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

Respuesta aceptada

Andrei Bobrov
Andrei Bobrov el 9 de Sept. de 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];

Más respuestas (1)

Walter Roberson
Walter Roberson el 9 de Sept. de 2013
Editada: Jan el 9 de Sept. de 2013
@Parul: Read the documentation for min()
  1 comentario
Jan
Jan el 9 de Sept. de 2013
Searching in the forum would reveal several similar discussions also.

Iniciar sesión para comentar.

Categorías

Más información sobre Operators and Elementary Operations en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by