|
- x = -5:.1:5;
- y = sin(x);
- y1=tanh(x);
- y2=cos(x);
- y3=exp(x);
- y4=0.5*x;
- y5=-0.5*x;
- y6=0.1*x.^2;
- y7=1./x;
- y8=sinh(x);
- y9=cosh(x);
- set(0,'defaultfigurecolor','w');
- figure;
- plot(x,y,'-o');
- hold on;
- plot(x,y1,'-^');
- plot(x,y2,'-+');
- plot(x,y3,'-*');
- plot(x,y4,'-.');
- plot(x,y5,'-x');
- plot(x,y6,'-s');
- plot(x,y7,'-d');
- plot(x,y8,'-p');
- plot(x,y9,'-h');
- axis([-5 5 -1 1]);
- legend('sin(x)','tanh(x)','cos(x)','e^x','0.5x','-0.5x','0.1x^2','1/x','sinh(x)','cosh(x)');
- xlabel('x');
- ylabel('y');
% N5 O: H1 \" m) k; D . g' ?/ C# ]0 _( l) _% k/ I/ @
, e% t& {0 p1 U/ ]
- f9 A* ?7 Z% |* |: q+ R8 r5 O. v+ r
4 g( S5 e( N8 P$ H5 w ]7 p% e/ x |
|