%--演示案例4-1-1-绘制平面曲线y=exp(-0.5*x)*sin(3*x+pi/6)
x=linspace(0,10,100);
y=exp(-0.5*x).*sin(3*x+pi/6);
plot(x,y,'r')
%--演示案例4-1-2-绘制平面曲线y=x/(1+x^2);
x=linspace(-5,5,51);
y=x./(1+x.^2);
plot(x,y)
%---演示案例4-1-3极坐标系下作图演示r=2*(1-cos(5*t))
subplot(2,2,1)
t=linspace(0,2*pi,100);
polar(t,2*(1-cos(5*t)))
%polarplot
%---演示案例4-1-4-字符串方式作图函数fplot,自动采样
fplot('exp(-0.5*x).*sin(x+1)',[0,6])
%---演示案例4-1-5-符号作图函数ezplot
syms t
ezplot(exp(-0.5*t).*sin(t+1),[0,10])
%----案例演示4-3-1-空间曲线
clc,clear, figure(1)
% t=linspace(-10,10,201);
% xt = exp(-t/10).*sin(3*t);
% yt = exp(-t/10).*cos(3*t);
% zt = t;
% plot3(xt,yt,zt,'r:')
% title('Line in 3-D Space');
% text(0,0,0,'origin');
% xlabel('X'),ylabel('Y'),zlabel('Z');
% grid;
% box on
%----案例演示4-3-2-空间曲线
% t=(0:0.02:2)*pi;
% x=sin(t);
% y=cos(t);
% z=cos(2*t);
% plot3(x,y,z,'r-',x,y,z,'bd'),
% view([-82,58])
% box on
% legend('链','宝石')
%----案例演示4-3-2-空间曲线
% t=0:pi/50:2*pi;
% x=8*cos(t);
% y=4*sqrt(2)*sin(t);
% z=-4*sqrt(2)*sin(t);
% plot3(x,y,z,'p');
% title('Line in 3-D Space');text(0,0,0,'origin');
% xlabel('X'),ylabel('Y'),zlabel('Z');grid;
% plot3(x,y,z,'p');
%%----演示案例4-3-3-绘制空间曲面
x = -5:0.5:5;
y = -8:0.5:8;
[X,Y] = meshgrid(x,y);
plot(X,Y,'r*')
Z=X.^2/25-Y.^2/64;
mesh(X,Y,Z)
figure(2)
mesh(x,y',Z)
figure(3)
mesh(x,y,Z)

