How do i get the position of the minimum value in at 3 dimensional array?

1 vue (au cours des 30 derniers jours)
maarten de Jong
maarten de Jong le 29 Déc 2016
Modifié(e) : Matt J le 29 Déc 2016
If I have a 3 dimensional array, an I want to find the position of the minimal value of that array, preferably in vector form, what command do I use?

Réponses (1)

Matt J
Matt J le 29 Déc 2016
Modifié(e) : Matt J le 29 Déc 2016
minval=min(yourArray(:));
[xloc,yloc,zloc] = ind2sub(size(yourArray), find(yourArray==minval) )

Catégories

En savoir plus sur Data Types 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!

Translated by