我的matlab运行程序后没反应

2024-11-16 18:53:41
推荐回答(1个)
回答1:

S=[500,2150;4500,3450;2100,900;3300,2300;7800,1150;3000,900;4500,2300;6000,2400;2400,1200;2400,2400;5400,3000;9600,4500;2100,1500];
x=[800,800;600,600;400,400;300,300;600,300;300,600];
for j=1:6
for i=1:13
a(i,j)=floor(S(i,1)/x(j,1));
b(i,j)=floor(S(i,2)/x(j,2));
end
end
for j=1:6;
for i=1:13
if a(i,j)~=ceil(S(i,1)/x(j,1))&b(i,j)~=ceil(S(i,2)/x(j,2))
n(j,i)=a(i,j)*b(i,j)+a(i,j)+b(i,j);
elseif a(i,j)==ceil(S(i,1)/x(j,1))&b(i,j)~=ceil(S(i,2)/x(j,2))
n(j,i)=a(i,j)*b(i,j)+a(i,j);
elseif a(i,j)~=ceil(S(i,1)/x(j,1))&b(i,j)==ceil(S(i,2)/x(j,2))
n(j,i)=a(i,j)*b(i,j)+b(i,j);
elseif a(i,j)==ceil(S(i,1)/x(j,1))&b(i,j)==ceil(S(i,2)/x(j,2))
n(j,i)=a(i,j)*b(i,j);
end
end
end
for j=1:6
m(j)=0;
for i=1:13
% printf('第j种砖应用于第i块矩形的块数%d','n(j,i)');
m(j)=n(j,i)+m(j);
end
end
for j=1:6
m(j);
q=[0.92,0.93,0.95,0.97,0.94,0.94];
t=[180,130,72,45,80,80];
for j=1:6
k(j)=0;
for i=1:13
k(j)=k(j)+a(i,j)*b(i,j);
end
end
for j=1:6
k(j);
end
for j=1:6
i=1;
w(j,i)=(t(j)*k(j))/q(j);
end
for j=1:6
h(j)=0;
for i=1:13
if a(i,j)~=ceil(S(i,1)/x(j,1))&b(i,j)~=(S(i,2)/x(j,2))
h(j)=h(j)+a(i,j)+b(i,j)-1;
elseif a(i,j)==ceil(S(i,1)/x(j,1))&b(i,j)~=(S(i,2)/x(j,2))
h(j)=h(j)+a(i,j);
elseif a(i,j)~=ceil(S(i,1)/x(j,1))&b(i,j)==(S(i,2)/x(j,2))
h(j)=h(j)+b(i,j);
end
end
end
for j=1:6
h(j);
for j=1:6
i=2;
w(j,i)=(t(j)*h(j))/q(j)+h(j)*4;
for j=1:6
c(j)=m(j)*x(j,1)*x(j,2);
p(j)=c(j)/114070000;
end
end
end
end
你也没输出。。。所以只能从变量窗口看运行