Basically what I want to do is similar to here https://uk.mathworks.com/matlabcentral/answers/267009-generating-all-possible-pairs-of-polynomial-interaction-combinations i.e. I want to generate all possible power polinomial witch each term less than a certain number. My code is here
clear allclc%%input;
mu=7;my=7;me=7;delay=1;degree=2;totalD=my+mu+me;A = cell(totalD,1);[A{1:totalD}] = ndgrid([0:degree]);for k=1:totalDpolyPow(:,k)=reshape(A{k},[],1);endpolyPow(sum(polyPow,2)>degree,:) = [];
The problem I am facing now. If the inputs mu,my, and me (also degree) are a bit big, the matrix A becomes very large and I got error "Requested 3x3x3x3x3x3x3x3x3x3x3x3x3x3x3x3x3x3x3x3x3 (77.9GB) array exceeds maximum array size preference". Anyone has a better idea for my purpose?
Thank you
Best Answer