Azzera filtri
Azzera filtri

how to calculate perms for cell array vector

1 visualizzazione (ultimi 30 giorni)
Mohamad Javadzadeh
Mohamad Javadzadeh il 29 Giu 2021
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;

Risposte (0)

Categorie

Scopri di più su Multidimensional Arrays in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by