Transferring cell array elements into a matrix

조회 수: 1 (최근 30일)
Stewart Tan
Stewart Tan 2019년 8월 13일
댓글: madhan ravi 2019년 8월 13일
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일
test_ca = {[1 2 3],[4 5 6];[7 8 9],[10 11 12]} .';
new_mat = cat(1,test_ca{:})

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Image Processing Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by