Borrar filtros
Borrar filtros

string to double conversion

1 visualización (últimos 30 días)
Somnath Kale
Somnath Kale el 4 de En. de 2021
Editada: Somnath Kale el 4 de En. de 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!!
  1 comentario
Somnath Kale
Somnath Kale el 4 de En. de 2021
Editada: Somnath Kale el 4 de En. de 2021
thanks Stephan!!

Iniciar sesión para comentar.

Respuesta aceptada

Stephen23
Stephen23 el 4 de En. de 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

Más respuestas (0)

Categorías

Más información sobre Characters and Strings en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by