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

2 Commenti

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

Accedi per commentare.

 Risposta accettata

per isakson
per isakson il 7 Lug 2019
Modificato: per isakson il 7 Lug 2019

2 voti

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.

Più risposte (0)

Prodotti

Community Treasure Hunt

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

Start Hunting!

Translated by