MATLAB: All combination for a cell structure

cellmat2cell

Hi all,
I'd like to get all combinations for all elements in a cell structure. For example,
var = rand(20, 3);
no = 5;
numcell = mat2cell(var, size(var, 1)/no*ones(1, no), ones(1, 3));
result in a 5 by 3 cell 'numcell' which contains 4 by 1 double for each cell.
I'd like to find all combinations among 5 by 3 'numcell', performing the calculation numcell{:}*numcell{:}' for each cell element of numcell. So that I'll get all permutation and combination of numcell{i}'*numcell{j}.
Thanks!

Best Answer

I correctly understand:
out = cellfun(@(x)a(:).'*a(:),numcell);