nan in if statement
古いコメントを表示
Hi all,
How can I say:
if (a==0 or a==NaN)
%whatever
end
Thanks.
1 件のコメント
JKD Power and Energy Solutions
2021 年 3 月 31 日
Use the below code:
if (a==0 || isnan(a))
%whatever
end
回答 (2 件)
David Hill
2021 年 3 月 31 日
if ~a||isnan(a)
Hernia Baby
2021 年 3 月 31 日
clc, clear
a = NaN;
if a==0 | isnan(a)
%whatever
a
end
a =
NaN
カテゴリ
ヘルプ センター および File Exchange で MATLAB についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!