Converting 2D cell array to 3D matrix
16 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Lyle Edwards
am 9 Jun. 2023
Kommentiert: Lyle Edwards
am 10 Jun. 2023
I have a cell that is [8x454] with each element in the cell containing a [900x1] matrix. I would like to convert this cell into a 3 dimensional matrix of size [8x454x900]. Ive tried some things including reshape, cat and permute but can never seem to get it right. Any help would be greatly appreciated!
0 Kommentare
Akzeptierte Antwort
James Tursa
am 10 Jun. 2023
Bearbeitet: James Tursa
am 10 Jun. 2023
E.g.,
MyCell = repmat({(1:4)'},2,3) % small sample data
[m,n] = size(MyCell);
reshape(cell2mat(MyCell(:)').',m,n,[])
size(ans)
Weitere Antworten (1)
Siehe auch
Kategorien
Mehr zu Matrices and Arrays finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!