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!