用matlab怎么在圆域x^2+y^2<=1上,画出函数z=x*y的图像,

2024-12-31 20:41:51
推荐回答(2个)
回答1:

[theta r]=meshgrid(linspace(0,2*pi,100),linspace(0,1,20));

[x y]=pol2cart(theta,r);

z=x.*y;

mesh(x,y,z);


回答2:

[r,t]=meshgrid(0:0.1:1,0:0.02:2*pi);

x=r.*cos(t);

y=r.*sin(t);

z=x.*y;

mesh(x,y,z)