Azzera filtri
Azzera filtri

string to double conversion

1 visualizzazione (ultimi 30 giorni)
Somnath Kale
Somnath Kale il 4 Gen 2021
Modificato: Somnath Kale il 4 Gen 2021
hii all,
i have this series of string and i wanted to convert each comma seperated value into doubles
Current =
'+5.004100E-07,+5.006900E-07,+5.003900E-07,+5.003100E-07,+5.003300E-07,+5.003700E-07,+5.004800E-07,+5.003200E-07,+5.003600E-07,+5.003900E-07'
I tried several ways but using table and text file conversion but unable to do so
can some one please help?
thanks in advance!!

Risposta accettata

Stephen23
Stephen23 il 4 Gen 2021
Current = '+5.004100E-07,+5.006900E-07,+5.003900E-07,+5.003100E-07,+5.003300E-07,+5.003700E-07,+5.004800E-07,+5.003200E-07,+5.003600E-07,+5.003900E-07';
V = sscanf(Current,'%f,')
V = 10×1
5.004100000000000e-07 5.006900000000000e-07 5.003900000000000e-07 5.003100000000000e-07 5.003300000000000e-07 5.003700000000000e-07 5.004800000000000e-07 5.003200000000000e-07 5.003600000000000e-07 5.003900000000000e-07

Più risposte (0)

Categorie

Scopri di più su Characters and Strings in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by