How tatement to use if statement to eliminate unwanted value

2 ビュー (過去 30 日間)
sadiqa ilyas
sadiqa ilyas 2019 年 9 月 21 日
コメント済み: sadiqa ilyas 2019 年 9 月 21 日
Hi,.
I have set of values like .001,0.002,...inf
i want to find the max value from these excluding inf
X=U/10000;
i=[X]
m=max(i);
if m == Inf;
m=m(i-1);
end
How to get rid of Inf.
  1 件のコメント
sadiqa ilyas
sadiqa ilyas 2019 年 9 月 21 日
0.0001
0.0002
0.0003
0.0004
0.0005
0.0006
0.0007
0.0008
0.0009
0.0010
0.0011
0.0012
0.0013
0.0014
0.0015
0.0016
Inf
Values from which i have to select maximum number and exclude inf

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

採用された回答

David Hill
David Hill 2019 年 9 月 21 日
m=max(i(i~=Inf));
  2 件のコメント
sadiqa ilyas
sadiqa ilyas 2019 年 9 月 21 日
still gives infinity
sadiqa ilyas
sadiqa ilyas 2019 年 9 月 21 日
it works .thank u so much

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

その他の回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by