MATLAB Answers

0

is it a bug?

G A 님이 질문을 제출함. 7 Jul 2019
최근 활동 per isakson 님이 편집함. 7 Jul 2019
str2num('"abc"')
ans =
"abc"

  댓글 수: 2

Image Analyst
on 7 Jul 2019
What were you expecting to see?
G A
on 7 Jul 2019
In the version r2015b, the answer was []. I do not think that "abc" is a number.

로그인 to comment.

태그

제품

답변 수: 1

Answer by per isakson
on 7 Jul 2019
Edited by per isakson
on 7 Jul 2019
 Accepted Answer

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

로그인 to comment.



Translated by