find minimum value greater than zero in the rows

75 次查看(过去 30 天)
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

采纳的回答

Andrei Bobrov
Andrei Bobrov 2014-6-10
a(a == 0) = inf;
b = min(a,[],2);
  3 个评论

请先登录,再进行评论。

更多回答(1 个)

Matt J
Matt J 2014-6-10
编辑:Matt J 2014-6-10
The min command plus
a(a<=0)=nan;

类别

Help CenterFile Exchange 中查找有关 Logical 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by