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

1 Kommentar

Use the below code:
if (a==0 || isnan(a))
%whatever
end

Melden Sie sich an, um zu kommentieren.

Antworten (2)

Hernia Baby
Hernia Baby am 31 Mär. 2021

1 Stimme

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

Kategorien

Mehr zu MATLAB finden Sie in Hilfe-Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by