[SOLVED] MatLab help: NaN - What am I doing wrong?

Status
Not open for further replies.
Re: MatLab help: NaN..............

Hi,

Logical operators (like "==") involving NaN return always FALSE, except "~=".
This is because as a NaN is not a number it can not be equal to anything.
Use "isnan" function instead:

if isnan(x)
x=0;
end

Regards

Z
 

Re: MatLab help: NaN..............

Thank you very much.
I need to do a lot of work to make the change, but at least now I understand.
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…