Dimensions of matrices being concatenated are not consistent error for cell2mat

2 ビュー (過去 30 日間)
sermet
sermet 2016 年 8 月 28 日
回答済み: Star Strider 2016 年 8 月 28 日
out =
'01'
'0.5846023560E-002'
'405504.0000'
'0.9652538155'
'-0.7828897534E-008'
'5153.587402'
'0.2494223175E+001'
'0.529637577'
'0.1359485230E+001'
out = 9*1 cell. I need to convert numeric values of each element of out. I applied
cell2mat(out)
but it gives "Dimensions of matrices being concatenated are not consistent" error. But when I apply
str2num((cell2mat(out(2))))
second element of out converted numeric value. How can I convert numeric values of each element of out?

採用された回答

Star Strider
Star Strider 2016 年 8 月 28 日
To convert it to a numeric array, use str2double:
V = str2double(out)
V =
1.0000e+000
5.8460e-003
405.5040e+003
965.2538e-003
-7.8289e-009
5.1536e+003
2.4942e+000
529.6376e-003
1.3595e+000

その他の回答 (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