convert char to double
33 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
var = '0' (this is char)
and i want this value convert 'double'
so i used
out = str2double(regexp(var,'\d*','match')
But I have a parse error
How can I get the val value in double?
For reference, if str2double is used, the NAN value is obtained.
1 comentario
Respuestas (1)
Davide Masiello
el 27 de Sept. de 2022
Editada: Davide Masiello
el 27 de Sept. de 2022
var = '0';
out = str2double(var)
whos out
No need to use regular expressions at all, at least in Matlab.
3 comentarios
Davide Masiello
el 27 de Sept. de 2022
What you see in my answer is obtained running Matlab R2022b.
What version do you use?
Ver también
Categorías
Más información sobre Data Type Conversion en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!