is it a bug?

8 ビュー (過去 30 日間)
G A
G A 2019 年 7 月 7 日
編集済み: per isakson 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