element in 2D array
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
how can find minimun element in 2D array
0 commentaires
Réponse acceptée
Walter Roberson
le 5 Fév 2013
Modifié(e) : Walter Roberson
le 5 Fév 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 commentaires
Plus de réponses (1)
James Tursa
le 5 Fév 2013
Not exactly sure what you want, but here is code to find the minimum value:
x = rand(2,2);
m = min(x(:));
0 commentaires
Voir également
Catégories
En savoir plus sur Multidimensional Arrays dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!