How to convert char into double?
720 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Hello everyone,
I have following char: "2.311.592 /" And I want to convert it to double and leave numbers only, I have tried to use
new = str2double(val);
But the output was NaN, what would you recommend me to do?
3 Commenti
Risposta accettata
Più risposte (2)
Whashak Faeid
il 25 Ago 2020
How can I change '$11.75' this data type from char to doube.I want my output $11.75 as a double in data type.
Thanks in advance.
1 Commento
Stephen23
il 25 Ago 2020
>> str = '$11.75';
>> val = sscanf(str,'$%f')
val = 11.750
Vedere anche
Categorie
Scopri di più su Data Type Conversion in Help Center e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!