Borrar filtros
Borrar filtros

how to calculate perms for cell array vector

1 visualización (últimos 30 días)
Mohamad Javadzadeh
Mohamad Javadzadeh el 29 de Jun. de 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;

Respuestas (0)

Categorías

Más información sobre Multidimensional Arrays en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by