Reputation: 13
I am new to programming and i start with Matlab. How to convert this expression to a MATLAB code :
a = if !IsNaN(x) then b else Double.NaN;
Upvotes: 0
Views: 59
Reputation: 272
The "not" functionality of "!" is implemented by "~" in MATLAB.
So, your code would look something like
if ~isnan(x)
a = b
else
a = NaN;
end
Upvotes: 2