convert string to number or array

7 ビュー (過去 30 日間)
TTA
TTA 2019 年 10 月 8 日
回答済み: the cyclist 2019 年 10 月 8 日
Please I want to convert this array to an array. if I use str2double I obtain those starting 0.something as NAN.
please help
' 0. 9'
' 0. 9'
' 1. 2'
' 1. 4'
' 1.14'
' 1.39'
' 1.42'
' 1.45'
' 1.46'
' 1.59'
' 2.28'
' 2.34'
' 2.43'
' 3.18'
' 3.35'
' 4.10'
' 4.48'
'11.24'
'11.33'
'11.33'
'12.13'
'12.32'
'12.54'
'13. 2'
'13. 5'
'13. 9'
'13.13'
'13.13'
'13.22'
'13.22'
'13.50'
'13.57'
'14.16'
'14.19'
'14.41'
'14.42'
'14.44'
'14.46'
'14.48'
'14.53'
'14.53'
'14.57'
'15.33'
'15.33'
'15.59'
'16. 6'
'16.10'
'16.12'
'16.14'
'16.19'
'16.27'
'16.37'
'16.37'
'17. 7'
'17.14'
'17.27'
'17.40'
'17.47'
'17.51'
'18. 4'
'18. 4'
'21.26'
'21.26'
'21.29'
'23.10'
'23.18'
'23.44'
'23.48'
'23.57'

採用された回答

the cyclist
the cyclist 2019 年 10 月 8 日
I'm guessing it's the space that is causing the problem. Run your array through
x = regexprep(x,' ','');
first to remove the spaces.

その他の回答 (0 件)

カテゴリ

Help Center および 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