Effacer les filtres
Effacer les filtres

find minimum value greater than zero in the rows

75 vues (au cours des 30 derniers jours)
Bathrinath
Bathrinath le 10 Juin 2014
Commenté : Andrei Bobrov le 10 Juin 2014
a=[9,32,7,0,0,0,0,0;15,32,9,0,0,0,0,0;25,42,0,0,0,0,0,0];i have to find out minimum value in 'a' which should be greater than zero.my answer has to be b=[7;9;25].suggest some points

Réponse acceptée

Andrei Bobrov
Andrei Bobrov le 10 Juin 2014
a(a == 0) = inf;
b = min(a,[],2);
  3 commentaires
Bathrinath
Bathrinath le 10 Juin 2014
Thank you sir
Andrei Bobrov
Andrei Bobrov le 10 Juin 2014
Thank you Image Analyst! I agree with you.

Connectez-vous pour commenter.

Plus de réponses (1)

Matt J
Matt J le 10 Juin 2014
Modifié(e) : Matt J le 10 Juin 2014
The min command plus
a(a<=0)=nan;

Catégories

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