splitting large cell array into smaller cell arrays
Show older comments
hi
I have a large cell array "a" (5290*1) such that each element of the array is of size e.g. size(a{1,1}) = 21*204
i want to split these further such that each element of a{1,1} contains another cell array such that size of a{1,1}.b1 = 3*204 and i have a{1,1}.b1, a{1,1}.b2.... a{1,1}.b7 so a{1,1} contains 7 cells of size 3*204. how can i achieve this without for loop?
Many thanks for you help.
Accepted Answer
More Answers (1)
Guillaume
on 27 Apr 2015
newa = cellfun(@(m) mat2cell(m, 3*one(1, 7), 204), a, 'UniformOutput', false)
Categories
Find more on Matrix Indexing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!