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!