三维曲线
>> t=0:pi/50:10*pi;
>> plot3(sin(2*t),cos(2*t),t)
>> axis square
>> grid on
2、一窗口多图形
>> t=-2*pi:0.01:2*pi;
>> subplot(3,2,1)
>> plot(t,sin(t))
>> subplot(3,2,2)
>> plot(t,cos(t))
>> subplot(3,2,3)
>> plot(t,tan(t))
>> axis([-pi pi -100 100])
>> subplot(3,2,4)
>> plot(t,cot(t))
>> axis([-pi pi -100 100])
>> subplot(3,2,5)
>> plot(t,atan(t))
>> subplot(3,2,6)
>> plot(t,acot(t))
3、图形样式、标注、题字
(也可以利用菜单直接Insert)
>> x=0:pi/20:2*pi;
>> plot(x,sin(x),'b-.')
>> hold on
>> plot(x,cos(x),'r--')
>> hold on
>> plot(x,sin(x)-1,'g:')
>> hold on
>> plot(x,cos(x)-1)
>> xlabel('x');
>> xlabel('x轴');
>> ylabel('y轴');
>> title('图形样式、标注等');
>> text(pi,sin(pi),'x=\pi');
>> legend('sin(x)','cos(x)','sin(x)-1','cos(x)-1');
>> [x1,y1]=ginput(1) %利用鼠标定位查找线上某点的值
x1 =
2.0893