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!