string to double conversion

5 ビュー (過去 30 日間)
Somnath Kale
Somnath Kale 2021 年 1 月 4 日
編集済み: Somnath Kale 2021 年 1 月 4 日
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 件のコメント
Somnath Kale
Somnath Kale 2021 年 1 月 4 日
編集済み: Somnath Kale 2021 年 1 月 4 日
thanks Stephan!!

サインインしてコメントする。

採用された回答

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 Center および File ExchangeCharacters and Strings についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by