matlab高手帮我看看程序错哪里吧

2025-06-24 00:08:36
推荐回答(2个)
回答1:

x=-6:0.012:6;

y=-4:0.008:4;

[X,Y] = meshgrid(x,y);           

z1=(sin(sqrt(X.^2+Y.^2)))./sqrt(X.^2+Y.^2);

subplot(2,2,1);

surfc(X,Y,z1)

shading  interp

z2=100*(Y-X.^2).^2+(1-X).^2;

subplot(2,2,2);

surfc(X,Y,z2)

shading interp

z3=atan(X.^4+sin(Y));

subplot(2,2,3);

surfc(X,Y,z3)

shading interp

 

 

 

画3D图要用矩阵来运算,用向量不要用surfc

arcos是你自创的吧?应该是acos

而且acos的范围是-1~1你的熟入范围不对,我给你换成了atan

回答2:

编译报错信息都不给出来。。