Convert a string to number
Mostra commenti meno recenti
Hi, I want to convert a string into a number however I don't want to use str2num since I loose extra digits (see example below). Can I use some other MATLAB function?
data = 0.0782238;
s = str2num(data); %Don't want this since s = 0.0782 and I'm loosing three extra digits
Risposta accettata
Più risposte (1)
Wayne King
il 5 Feb 2014
Modificato: Wayne King
il 5 Feb 2014
how about just using format long
data = '0.0782238';
data = str2num(data);
format long
data
Categorie
Scopri di più su Data Type Conversion in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!