is it a bug?

2 次查看(过去 30 天)
G A
G A 2019-7-7
str2num('"abc"')
ans =
"abc"
  2 个评论
Image Analyst
Image Analyst 2019-7-7
What were you expecting to see?
G A
G A 2019-7-7
编辑:G A 2019-7-7
In the version r2015b, the answer was []. I do not think that "abc" is a number.

请先登录,再进行评论。

采纳的回答

per isakson
per isakson 2019-7-7
编辑:per isakson 2019-7-7
I call this a bug.
My comments
The last lines of str2num() read
if ischar(x) || iscell(x)
x = [];
ok = false;
end
Adding || isstring to the condition solves the problem - I think.

更多回答(0 个)

标签

产品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by