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!