matlab,循环语句,d=14.6;d1=14.4;d2=12.4;h1=0.32;L=0.75;h2=5;x1=60;x2=14;h3=13.2;h4=2.2;a=Li=0for h=0:0.2:17.2i=i+1S0(i)=pi*d2.^2/4+pi*(d.^2-d1.^2)/4;S1(i)=pi*d*hS2(i)=pi*(d.^2-d1.^2)/4S3(i)=(h-h1)*LS4(i)=pi*(d.^2-d1.^2)/4+2*(h-h1)*Lb(i)=2*(h-h2)*t
来源:学生作业帮助网 编辑:作业帮 时间:2024/11/17 21:46:30
matlab,循环语句,d=14.6;d1=14.4;d2=12.4;h1=0.32;L=0.75;h2=5;x1=60;x2=14;h3=13.2;h4=2.2;a=Li=0for h=0:0.2:17.2i=i+1S0(i)=pi*d2.^2/4+pi*(d.^2-d1.^2)/4;S1(i)=pi*d*hS2(i)=pi*(d.^2-d1.^2)/4S3(i)=(h-h1)*LS4(i)=pi*(d.^2-d1.^2)/4+2*(h-h1)*Lb(i)=2*(h-h2)*t
matlab,循环语句,
d=14.6;
d1=14.4;
d2=12.4;
h1=0.32;
L=0.75;
h2=5;
x1=60;
x2=14;
h3=13.2;
h4=2.2;
a=L
i=0
for h=0:0.2:17.2
i=i+1
S0(i)=pi*d2.^2/4+pi*(d.^2-d1.^2)/4;
S1(i)=pi*d*h
S2(i)=pi*(d.^2-d1.^2)/4
S3(i)=(h-h1)*L
S4(i)=pi*(d.^2-d1.^2)/4+2*(h-h1)*L
b(i)=2*(h-h2)*tand(x1/2)+L
h0(i)=h-h2
S5(i)=(a+b).*h0./2;
S6(i)=pi*(d.^2-d1.^2)/4+2*(h-h1)*L+(a+b).*h0./2
S7(i)=2.*L.*(h2-h1)+2*(h3-h2).*(L+tand(x1/2).*(h3-h2))+pi*d.^2/4*cosd(x2)-pi*...
(d/2-(cosd(x2)).^2.*((h-h3).*tand(x2)+d/2-d1/2)).*(d/2/cosd(x2).*...
((h-h3).*tand(x2)+d/2-d1/2))
S8(i)=pi*d^2/4
if S0(i)
matlab,循环语句,d=14.6;d1=14.4;d2=12.4;h1=0.32;L=0.75;h2=5;x1=60;x2=14;h3=13.2;h4=2.2;a=Li=0for h=0:0.2:17.2i=i+1S0(i)=pi*d2.^2/4+pi*(d.^2-d1.^2)/4;S1(i)=pi*d*hS2(i)=pi*(d.^2-d1.^2)/4S3(i)=(h-h1)*LS4(i)=pi*(d.^2-d1.^2)/4+2*(h-h1)*Lb(i)=2*(h-h2)*t
目前最致命的错误是下面这段代码:
h0(i)=h-h2
S5(i)=(a+b).*h0./2;
在你的代码中,当i大于1的时候,h0中的元素就多了,而这个时候,你再用h0一个整体的矩阵去代入S5(i)=(a+b).*h0./2;中计算,这样会出现矩阵元素个数不一致的错误.因此 这个地方需要修改.至于怎么改需要看你的需求,如果还有问题,请加QQ 544402256 验证信息:matlab (请一定要填写验证信息)