Borrar filtros
Borrar filtros

element in 2D array

1 visualización (últimos 30 días)
Umair Altaf
Umair Altaf el 5 de Feb. de 2013
how can find minimun element in 2D array

Respuesta aceptada

Walter Roberson
Walter Roberson el 5 de Feb. de 2013
Editada: Walter Roberson el 5 de Feb. de 2013
[minval, minpos] = min(YourArray(:));
[minrow, mincol] = ind2sub(size(YourArray), minpos);
The above if you want to know the row and column as well as the value. If you just want the value then
minval = min(YourArray(:));

Más respuestas (1)

James Tursa
James Tursa el 5 de Feb. de 2013
Not exactly sure what you want, but here is code to find the minimum value:
x = rand(2,2);
m = min(x(:));

Categorías

Más información sobre Multidimensional Arrays en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by