matlab程序优化
y=rand(1,8,65536);j=1;
i=1;
p=0;
q=0;
for a=1:4;
for b=1:4;
for c=1:4;
for d=1:4;
for e=1:4;
for f=1:4;
for g=1:4;
for h=1:4;
y(:,:,j)=[a b c d e f g h];
j=j+1;
end
end
end
end
end
end
end
end
x=rand(1,8,390625);
for a1=0:4;
for a2=0:4;
for a3=0:4;
for a4=0:4;
for a5=0:4;
for a6=0:4;
for a7=0:4;
for a8=0:4;
x(:,:,i)=[a1 a2 a3 a4 a5 a6 a7 a8];
i=i+1;
end
end
end
end
end
end
end
end
for b1=1:390625;
for b2=1:390625;
for b3=1:390625;
for b4=1:390625;
for b5=1:390625;
for b6=1:390625;
for b7=1:390625;
for b8=1:390625;
X=[x(:,:,b1);x(:,:,b2);x(:,:,b3);x(:,:,b4);x(:,:,b5);x(:,:,b6);x(:,:,b7);x(:,:,b8)];
if rem(det(X),5)~=0;
p=p+1;
for r=1:65536;
z=y(:,:,r)*X;
if rem(z(1),5)~=0&&rem(z(2),5)~=0&&rem(z(3),5)~=0&&rem(z(4),5)~=0&&rem(z(5),5)~=0&&rem(z(6),5)~=0&&rem(z(7),5)~=0&&rem(z(8),5)~=0;
q=q+1;
break
end
end
end
end
end
end
end
end
end
end
end
if p==q;
'True'
else
'Wrong'
end
我这个程序编的循环太多,能不能帮忙计算或者优化一下计算,电脑实在跑不出来。