how to calculate perms for cell array vector

1 次查看(过去 30 天)
hi
i wanted to add repeation to cell arrays e.g i have [1,2] but dont have [1,1] or [2,2] i wanted to add this for all cell arrays, thank you
vec = 1:10;
n=5;
fun = @(n)num2cell(combnk(vec,n),2);
out = arrayfun(fun,1:5,'uniformoutput',0);
out = vertcat(out{:});
for i=1:length(out)
a(i,1)=sum(cell2mat(out (i,:)))<=10;
end
ind = find (a(:,1)==0);
out(ind,:)=[];n;

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Multidimensional Arrays 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by