フィルターのクリア

how to calculate perms for cell array vector

1 回表示 (過去 30 日間)
Mohamad Javadzadeh
Mohamad Javadzadeh 2021 年 6 月 29 日
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 Center および File ExchangeMultidimensional Arrays についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by