str2num('"abc"')
ans =
"abc"

2 commentaires

Image Analyst
Image Analyst le 7 Juil 2019
What were you expecting to see?
G A
G A le 7 Juil 2019
Modifié(e) : G A le 7 Juil 2019
In the version r2015b, the answer was []. I do not think that "abc" is a number.

Connectez-vous pour commenter.

 Réponse acceptée

per isakson
per isakson le 7 Juil 2019
Modifié(e) : per isakson le 7 Juil 2019

2 votes

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.

Plus de réponses (0)

Produits

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by