如何用Matlab绘制球面图形? 以不同视角观察球面: x^2+y^2+z^2=r^2; x^2+y^2=rx

2024-12-15 11:08:03
推荐回答(1个)
回答1:

clear all;clc;
r=2;
[x0,y0,z0]=sphere(50);
x=r*x0;y=r*y0;z=r*z0;
surf(x,y,z);hold on;
f=@(x,y)x.^2+y.^2-r*x;
ezsurf(f,[-1.5,2.5],[-2,1.5]);
axis equal;
view(30,20);