Filter löschen
Filter löschen

Cell2Mat for multiple columns

5 Ansichten (letzte 30 Tage)
Anna
Anna am 15 Okt. 2014
Beantwortet: Azzi Abdelmalek am 15 Okt. 2014
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.

Akzeptierte Antwort

Azzi Abdelmalek
Azzi Abdelmalek am 15 Okt. 2014

Weitere Antworten (0)

Kategorien

Mehr zu Cell Arrays finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by