nan in if statement
Afficher commentaires plus anciens
Hi all,
How can I say:
if (a==0 or a==NaN)
%whatever
end
Thanks.
1 commentaire
JKD Power and Energy Solutions
le 31 Mar 2021
Use the below code:
if (a==0 || isnan(a))
%whatever
end
Réponses (2)
David Hill
le 31 Mar 2021
if ~a||isnan(a)
Hernia Baby
le 31 Mar 2021
clc, clear
a = NaN;
if a==0 | isnan(a)
%whatever
a
end
a =
NaN
Catégories
En savoir plus sur MATLAB dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!