Hi all,
How can I say:
if (a==0 or a==NaN)
%whatever
end
Thanks.

댓글 수: 1

JKD Power and Energy Solutions
JKD Power and Energy Solutions 2021년 3월 31일
Use the below code:
if (a==0 || isnan(a))
%whatever
end

댓글을 달려면 로그인하십시오.

답변 (2개)

Hernia Baby
Hernia Baby 2021년 3월 31일

1 개 추천

clc, clear
a = NaN;
if a==0 | isnan(a)
%whatever
a
end
a =
NaN

카테고리

도움말 센터File Exchange에서 MATLAB에 대해 자세히 알아보기

질문:

2021년 3월 31일

Community Treasure Hunt

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

Start Hunting!

Translated by