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 Exchange에서 Data Type Conversion에 대해 자세히 알아보기

태그

질문:

2017년 11월 9일

답변:

2017년 11월 9일

Community Treasure Hunt

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

Start Hunting!

Translated by