- The old function, str2num(), uses eval() to do the conversion. "Eval is evil" or at least tricky to use. See https://se.mathworks.com/matlabcentral/answers/51946-systematic-do-not-use-global-don-t-use-eval#answer_63393
- The data type, string, is new.
- str2num('"abc"') is a clever test case, which I assume is not in their test suite.
is it a bug?
2 views (last 30 days)
per isakson on 7 Jul 2019
Edited: per isakson on 7 Jul 2019
I call this a bug.
The last lines of str2num() read
if ischar(x) || iscell(x)
x = ;
ok = false;
Adding || isstring to the condition solves the problem - I think.