Matlab起步 sin/cos/tan/asin/acos/atan function 1og/10g10 max/min sqrt/abs clf p1ot(x1,y1,’,x2,2,’,) title(‘text') PLOT figure xlable(‘text') close 1og1g(,1,’,22,’}) y1able(‘text') semilogx grid (x1,y1,’’,x2,y2,’’) text(pl,p2,’taxt”) hold on semology subplot (m,n,1) (x1,yl,’’,2y2,’’) :point y今yellow o今circle \beta m今1 genta x今x-maxk \gramna c今cyan r→red plus \delta sold \zeta x=[0:0.1:10] g今green b>blue star y=sin(x) :>-dotted w二)力1te -.→Dashdot plot(x.y,) k→black -dashed School of Mechanical Engineering ME369-Lecture 4.5 Shanghai Jiao Tong University Fall 2015 多项式运算 poly() roots() conv( polyval() X(s)=52+25+3 Z= Y(s)=s+4 161112 r= -4.0000 -1.0000+1.4142i -1.0000.1.4142i x=[123y-[14: p= z=conv(x,y) 1.00006.000011.000012.0000 =可oots(Z) p-poly(r) V= v=polyval(z,3) 126 School of Mechanical Engineering ME369-Lecture 4.5 Shanghai Jiao Tong University Fall 2015 22 ME369-Lecture 4.5 Fall 2015 School of Mechanical Engineering Shanghai Jiao Tong University function sin/cos/tan/asin/acos/atan log/log10 max/min sqrt/abs PLOT plot(x1,y1,’’,x2,y2,’’) loglog(x1,y1,’’,x2,y2,’’) semilogx (x1,y1,’’,x2,y2,’’) semology (x1,y1,’’,x2,y2,’’) title(‘text’) xlable(‘text’) ylable(‘text’) text(p1,p2,’text’) clf figure close grid hold on yyellow mmagenta ccyan rred ggreen bblue wwhite kblack . point ocircle xx-maxk +plus -sold * star : -dotted -.Dashdot --dashed \alpha \beta \gramma \delta \zeta \eta \theta …. x=[0:0.1:10] y=sin(x) plot(x,y,' ') subplot(m,n,l) Matlab 起步 ME369-Lecture 4.5 Fall 2015 School of Mechanical Engineering Shanghai Jiao Tong University poly() roots() conv() polyval() x=[1 2 3]; y=[1 4]; z=conv(x,y) r=roots(z) p=poly(r) v=polyval(z,3) ( ) 2 3 2 X s s s Y(s) s 4 z = 1 6 11 12 r = -4.0000 -1.0000 + 1.4142i -1.0000 - 1.4142i p = 1.0000 6.0000 11.0000 12.0000 v = 126 多项式运算