In MATLAB I am trying to do a function on a cell array, but am not having much luck. I would like to create a cellfun which checks whether str2double returns NaN values and then perform the str2double on the values which aren't NaNs. I'm trying to use an anonymous function with an IF Else sort of statement in it but not really getting anywhere. Here is what I have come up with so far:
x = cellfun(@(x)~isnan(str2double(x)),str2double(x))
However it doesn't work, could anybody help me out?
NaNafter callingstr2doubleon them?xis the input, the output and also the variable of the anonymous function. I think this is likely to be very confusing. At least change the anonymous function variable name.