In matlab I have a 4x5 cell array where each cell consists of an 121x1 vector.
What is the easiest way to create an 3-dim 4x5x121 matrix avoiding a 2-fold loop.
One way (not necessarily the fastest)
%# convert all arrays in the cell array inCell to 1x1x121
permCell = cellfun(@(x)permute(x,[3,2,1]),inCell,'uniformOutput',false);
%# catenate
array = cell2mat(permCell);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With