フィルターのクリア

convert string to number in a matrix

1 回表示 (過去 30 日間)
Xinfeng Li
Xinfeng Li 2018 年 8 月 5 日
コメント済み: dpb 2018 年 8 月 5 日
I have a matrix, but I found there is a error, some numbers are recognized as char. I want to convert these chars to number. Is there any good method?
'ps_ttm' 'fs_operating_revenue' 'fs_operating_revenue_ttm' 'fs_net_cash_flow' 'fs_roe_ttm' 'fs_deducted_profit_ttm' 'fs_roa' 'fs_operating_revenue_qoq'
0.360784860000000 6258259500.00000 0 733387900 0 0 0 0
0.369395460000000 6258259500.00000 0 733387900 0 0 0 0
0.374561850000000 6258259500.00000 0 733387900 0 0 0 0
0.381450330000000 6258259500.00000 0 733387900 0 0 0 0
0.372839720000000 6258259500.00000 0 733387900 0 0 0 0
0.371978640000000 6258259500.00000 0 733387900 0 0 0 0
0.365951200000000 6258259500.00000 0 733387900 0 0 0 0
0.359062730000000 6258259500.00000 0 733387900 0 0 0 0
0.365951200000000 6258259500.00000 0 733387900 0 0 0 0
0.372839720000000 6258259500.00000 0 733387900 0 0 0 0
0.386616700000000 6258259500.00000 0 733387900 0 0 0 0
0.390060930000000 6258259500.00000 0 733387900 0 0 0 0
0.406421120000000 6258259500.00000 0 733387900 0 0 0 0
0.399532620000000 6258259500.00000 0 733387900 0 0 0 0
0.408143250000000 6258259500.00000 0 733387900 0 0 0 0
0.411587480000000 6258259500.00000 0 733387900 0 0 0 0
0.410726430000000 6258259500.00000 0 733387900 0 0 0 0
0.390922000000000 6258259500.00000 0 733387900 0 0 0 0
0.409865350000000 6258259500.00000 0 733387900 0 0 0 0
0.352113660000000 15767742000.0000 '31271006000' 2933652200.00000 '34.6346' '2630252000' '4.3597' '51.9509'
  4 件のコメント
Image Analyst
Image Analyst 2018 年 8 月 5 日
Please attach the data file from which you got these along with the code you used to read it in.
dpb
dpb 2018 年 8 月 5 日
Along IA's request, look at
doc detectImportOptions
and the appropriate XXXImportOptions object for spreadsheet or delimited text linked to therein. In that import object you can then set the data format for variables not recognized automagically and pass that to the readtable function to import the data correctly.

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

回答 (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