Split a larger matrix into smaller matrices
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Kash022
am 17 Mär. 2016
Kommentiert: Star Strider
am 17 Mär. 2016
Hello All,
I have a [256 x 5 x 2000] matrix. I want to split this matrix into 5 [256 x 1 x 2000] matrices. Tried using mat2cell but it returns an error stating number of dimensions must match.
Could anyone please help me with this?
Thanks, \Kashif
0 Kommentare
Akzeptierte Antwort
Star Strider
am 17 Mär. 2016
The dimensions have to add to the same values in each dimension with mat2cell.
This works:
M = randi(9, 256, 5, 2000); % Create Matrix
C = mat2cell(M, 256, ones(1,5), 2000); % Split To Cells
6 Kommentare
Weitere Antworten (1)
Siehe auch
Kategorien
Mehr zu Characters and Strings 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!