Dimensions of matrices being concatenated are not consistent error for cell2mat
1 回表示 (過去 30 日間)
古いコメントを表示
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?
0 件のコメント
採用された回答
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 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Data Type Conversion についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!