Help with minimum of a matrix

3 vues (au cours des 30 derniers jours)
aurc89
aurc89 le 18 Sep 2014
Commenté : John D'Errico le 18 Sep 2014
Hello! I have a function which generates a matrix M containing elements. Some of them are infinite (- Inf for example). I need to extract the minimum finite value of M, but if I write min(M) I obtain of course - Inf. What command can I use ? Thanks

Réponse acceptée

Michael Haderlein
Michael Haderlein le 18 Sep 2014
min(M(~isinf(M))
  2 commentaires
aurc89
aurc89 le 18 Sep 2014
Thanks
John D'Errico
John D'Errico le 18 Sep 2014
Yep.

Connectez-vous pour commenter.

Plus de réponses (1)

Youssef  Khmou
Youssef Khmou le 18 Sep 2014
As are you are concerned about the global mean, you truncate the Inf elements and compute the min:
M(isinf(M))=[];
min(M)
  1 commentaire
aurc89
aurc89 le 18 Sep 2014
Thanks

Connectez-vous pour commenter.

Catégories

En savoir plus sur MATLAB 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