Cell arrays with a vector within a cell within a cell
Show older comments
I have a cell array where each element consists of a 1 x 1 cell containing a vector of type double, i.e., C{1,1} contains a vector of length N.
How do I convert the inner cells from 1 x 1 cells into N x 1 cells where the entries correspond to each vector of length N? The N of each vector might be different.
I think the right way to do this is via cellfun but something like
C_out = cellfun(@(C_test) num2cell(C_test{1}), C_in, 'uniform',0);
does not quite get me there.
Accepted Answer
More Answers (2)
Is this what you mean?
C_in={{[1;2;3]},{[4;5]},{6}}
C_out=[C_in{:}]
Categories
Find more on MATLAB 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!