【急】matlab显示错误Warning:Matrix dimensions must agree,not rendering mesh.程序如下,求大师指教i=1;j=1;for b=4:0.1:6Y(j)=b;j=j+1; endfor a=4:0.1:6X(i)=a;for b=4:0.1:6x=0:pi/50:pi/2;y=(60*9.8/(1+4*(0.1)^2)).*(3.*cos(x)-0.6.*sin(x)-(1-2
来源:学生作业帮助网 编辑:六六作业网 时间:2024/11/27 13:07:32
【急】matlab显示错误Warning:Matrix dimensions must agree,not rendering mesh.程序如下,求大师指教i=1;j=1;for b=4:0.1:6Y(j)=b;j=j+1; endfor a=4:0.1:6X(i)=a;for b=4:0.1:6x=0:pi/50:pi/2;y=(60*9.8/(1+4*(0.1)^2)).*(3.*cos(x)-0.6.*sin(x)-(1-2
【急】matlab显示错误Warning:Matrix dimensions must agree,not rendering mesh.程序如下,求大师指教
i=1;
j=1;
for b=4:0.1:6
Y(j)=b;
j=j+1;
end
for a=4:0.1:6
X(i)=a;
for b=4:0.1:6
x=0:pi/50:pi/2;
y=(60*9.8/(1+4*(0.1)^2)).*(3.*cos(x)-0.6.*sin(x)-(1-2*(0.1)^2).*exp(-0.2.*x)).*sqrt(a.^2.*(cos(x).^2)+b.^2.*(sin(x).^2))+60*144.*exp(-0.2.*x);
z=trapz(x,y);
z1=z+0.1*60*9.8*(10-a);
Z(j)=z1;
j=j+1;
end
i=i+1;
end
a=4:0.1:6;
b=4:0.1:6
[a,b]=meshgrid(a,b);
surf(a,b,Z)
大谢.回答即时会补分~
【急】matlab显示错误Warning:Matrix dimensions must agree,not rendering mesh.程序如下,求大师指教i=1;j=1;for b=4:0.1:6Y(j)=b;j=j+1; endfor a=4:0.1:6X(i)=a;for b=4:0.1:6x=0:pi/50:pi/2;y=(60*9.8/(1+4*(0.1)^2)).*(3.*cos(x)-0.6.*sin(x)-(1-2
i=1;
j=1;
for b=4:0.1:6
Y(j)=b;
j=j+1;
end
for a=4:0.1:6
X(i)=a;
for b=4:0.1:6
x=0:pi/50:pi/2;
y=(60*9.8/(1+4*(0.1)^2)).*(3.*cos(x)-0.6.*sin(x)-(1-2*(0.1)^2).*exp(-0.2.*x)).*sqrt(a.^2.*(cos(x).^2)+b.^2.*(sin(x).^2))+60*144.*exp(-0.2.*x);
z=trapz(x,y);
z1=z+0.1*60*9.8*(10-a);
Z(j)=z1;
j=j+1;
end
i=i+1;
end
a=4:0.1:6;
b=4:0.1:6;
[A,B]=meshgrid(a,b);
Z=reshape(Z(22:end),21,21);
surf(A,B,Z)