MATLAB: Maximum variable size allowed by the program is exceeded.

memory

I want generation of codes. My program is:
Q=6;
niu=9;
K=niu+1;
Nx=Q^K;
Vk=zeros(Nx,K);
for j=1:1:K
t=1;
for i=1:1:Nx
Vk(i,j)=mod((Vk(i,j)+(t-1)),Q);
a=Q^(j-1);
if mod(i,a)==0
t=t+1;
end;
end;
end;
Vk
It mean my massive size is 6^11X11 Can I split massive in circle? Help me please!!!

Best Answer

That array will require:
8*11*6^11
ans =
3.1926e+10
Just under 32gb. To do anything with it will require a copy or few. You could either, use a smaller array, work on pieces at a time, buy more ram, or use distributed arrays on a cluster.