function m = catcell(dim,m) <dim> is the dimension to concatenate along <m> is a cell matrix simply return cat(dim,m{:}). this function is useful because MATLAB doesn't provide an easy way to apply "{:}" to an arbitrary matrix. example: isequal(catcell(2,{1 2 3}),[1 2 3])
0001 function m = catcell(dim,m) 0002 0003 % function m = catcell(dim,m) 0004 % 0005 % <dim> is the dimension to concatenate along 0006 % <m> is a cell matrix 0007 % 0008 % simply return cat(dim,m{:}). this function is useful because 0009 % MATLAB doesn't provide an easy way to apply "{:}" to an 0010 % arbitrary matrix. 0011 % 0012 % example: 0013 % isequal(catcell(2,{1 2 3}),[1 2 3]) 0014 0015 m = cat(dim,m{:}); 0016 0017 % f = []; 0018 % for p=1:numel(m) 0019 % if p == 1 0020 % f = m{p}; 0021 % else 0022 % f = cat(dim,f,m{p}); 0023 % end 0024 % m{p} = []; 0025 % end