필터 지우기
필터 지우기

Cell2Mat for multiple columns

조회 수: 5 (최근 30일)
Anna
Anna 2014년 10월 15일
답변: Azzi Abdelmalek 2014년 10월 15일
If I have the 2x3x4 cell array:
g = cat(3, {1,2,3;4,5,6}, {11,12,13;14,15,16}, {21,22,23;24,25,26}, {31,32,33;34,35,36})
What is the best way to wrap this into a 2D matrix such that the matrix has 2 columns and 12 rows in each?
The first column would consist of 1,2,3,11,12,13,21,22,23,31,32,33 // The second column 4,5,6,14,15,16,24,25,26,34,35,36
Something like:
AllFrag = reshape(cell2mat(g),2,[]).'
Throws an error:
Error in cell2mat (line 119)
ct{mref{:}} = cat(cdim+1,c{mref{:},:});
and I'm not sure why.

채택된 답변

Azzi Abdelmalek
Azzi Abdelmalek 2014년 10월 15일

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Cell Arrays에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by