Hi!
I am importing data that sometimes imports as a string, and sometimes as a number. In all cases I want a number. Is there a function like string2double that can handle a numerical input?
Right now it works like:
>> str2num('2')ans = 2>> str2num(2)Error using str2num (line 35)Input must be a character vector or string scalar.
Ideally it would work like:
>> FunctionLikestr2num('2')ans = 2>> FunctionLikestr2num(2)ans = 2
Thank you!
Best Answer