Transferring cell array elements into a matrix

I have a cell array:
test_ca = {[1 2 3],[4 5 6];[7 8 9],[10 11 12]}
and i want to transfer these matrices in the cell array into a matrix where i would get:
new_mat = 1 2 3
4 5 6
7 8 9
10 11 12
however, i tried using cell2mat(test_ca) but ended up getting
new_mat = 1 2 3 4 5 6
7 8 9 10 11 12

 채택된 답변

madhan ravi
madhan ravi 2019년 8월 13일

0 개 추천

test_ca = {[1 2 3],[4 5 6];[7 8 9],[10 11 12]} .';
new_mat = cat(1,test_ca{:})

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Image Processing Toolbox에 대해 자세히 알아보기

질문:

2019년 8월 13일

댓글:

2019년 8월 13일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by