string to double conversion

2 次查看(过去 30 天)
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!!

采纳的回答

Stephen23
Stephen23 2021-1-4
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

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Characters and Strings 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by