how to find out position of minimum element in a matrix
    3 vues (au cours des 30 derniers jours)
  
       Afficher commentaires plus anciens
    
a=[8 2 5;2 -2 4;9 5 4] here position of minimum value is 2*2
0 commentaires
Réponse acceptée
  Rik
      
      
 le 7 Mai 2018
        a=[8 2 5;2 -2 4;9 5 4] ;
[r,c]=find(a==min(a(:)));
This will even work if there are multiple positions where the minimum value exists: in that case r and c will be vectors.
0 commentaires
Plus de réponses (0)
Voir également
Catégories
				En savoir plus sur Resizing and Reshaping Matrices 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!