find minimum value greater than zero in the rows

88 ビュー (過去 30 日間)
Bathrinath
Bathrinath 2014 年 6 月 10 日
コメント済み: Andrei Bobrov 2014 年 6 月 10 日
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 件のコメント
Bathrinath
Bathrinath 2014 年 6 月 10 日
Thank you sir
Andrei Bobrov
Andrei Bobrov 2014 年 6 月 10 日
Thank you Image Analyst! I agree with you.

サインインしてコメントする。

その他の回答 (1 件)

Matt J
Matt J 2014 年 6 月 10 日
編集済み: Matt J 2014 年 6 月 10 日
The min command plus
a(a<=0)=nan;

カテゴリ

Help Center および File ExchangeLogical についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by