Filter löschen
Filter löschen

element in 2D array

1 Ansicht (letzte 30 Tage)
Umair Altaf
Umair Altaf am 5 Feb. 2013
how can find minimun element in 2D array

Akzeptierte Antwort

Walter Roberson
Walter Roberson am 5 Feb. 2013
Bearbeitet: Walter Roberson am 5 Feb. 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(:));

Weitere Antworten (1)

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

Kategorien

Mehr zu Multidimensional Arrays finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by