How to convert string to double with powers?

>> str2double('0.88D+02')
ans =
NaN
I want to convert string '0.88D+02' to double 88 or 0.88D+02. However, When I use the above codes, it returns Nan. It works when I use str2num, but the length is too short. I can't convert long decimal number.

 採用された回答

Walter Roberson
Walter Roberson 2017 年 11 月 9 日

0 投票

str2double( regexprep('0.88D+02', 'D', 'E') )

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeData Type Conversion についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by