element in 2D array
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
how can find minimun element in 2D array
0 Commenti
Risposta accettata
Walter Roberson
il 5 Feb 2013
Modificato: Walter Roberson
il 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(:));
0 Commenti
Più risposte (1)
James Tursa
il 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(:));
0 Commenti
Vedere anche
Categorie
Scopri di più su Multidimensional Arrays in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!