Azzera filtri
Azzera filtri

Cell2Mat for multiple columns

5 visualizzazioni (ultimi 30 giorni)
Anna
Anna il 15 Ott 2014
Risposto: Azzi Abdelmalek il 15 Ott 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.

Risposta accettata

Azzi Abdelmalek
Azzi Abdelmalek il 15 Ott 2014

Più risposte (0)

Categorie

Scopri di più su Cell Arrays in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by