Notion de functions sin(pi/4) ans = 0.7071 cree fichee M-file : Velocity.m function v = Velocity(v0, a, t) v = v0 + a.*t; Utilisez dans work espace v = Velocity( 30, 9.81, ); Ouvert M-file Creer function Sauvagader pour les utiliser > Files > save as > Polynom x = [1 -15 -2 9] x = [1 0 1] Valeu du Polynom z = polyval( [1 0 1], ) Multiplication les polynoms X=S + et Y = S2 + 4S + =x = [1 2]; y = [1 8]; z = conv( x, y ) x = [1 2]; y = [1 8]; z = conv( x, y ) Z= 16 16 Decomposer le polynom Z [xx, R] = deconv( z, y ) XX = R= 0 0 => Z = S3 + 6S2 + 16S + 16 Racine de polinome P=[1 -2 -5] R = roots(p) R= 2.0946 -1.0473 + -1.0473 - 1.1359i 1.1359i P=poly(R) P= -2 -5 Matrices B = [1 4; 8; 10 11 12] B=[1234 5678 10 11 12] C = B' D=B*C E = [1 2; 4] F = [2 3; 5] G = E * F E^3 X = inv(E) Plot t = 0:0.25:7; y1 = sin( t ); y2 = cos( t ); y3 = y1 + y2; y4 = y1 - y2; subplot( 2, 2, ); plot( t, y1 ) subplot( 2, 2, ); plot( t, y2 ) subplot( 2, 2, ); plot( t, y3 ) subplot( 2, 2, ); plot( t, y4 ) plot(t, x, t, y); Plot t = -pi:pi/10:pi; y = sin( t ); plot( t, y, ' o', 'LineWidth', 2, 'MarkerEdgeColor', 'r', 'MarkerFaceColor', 'g', 'MarkerSize', 10 ) t = -pi:.1:pi; y = sin( t ); plot( t, y ) set( gca, 'XTick', -pi:pi/2:pi ) set( gca, 'XTickLabel', { '-pi', '-pi/2' , '0' , 'pi/2' , 'pi' } ) xlabel( '-\pi \leq \alpha \leq \pi' ) ylabel( 'sin(\alpha)' ) title( 'Plot of sin(\alpha)' ) text( -pi/4, sin(-pi/4), '\leftarrow sin(-\pi\div4)') Plot Plot polar coordinates polar(theta,rho) polar(theta,rho,LineSpec) t = 0:.01:2*pi; polar( t, sin( 2*t ) * cos( 2*t ), ' r' ) Histogram plot x = -2.9:0.1:2.9; y = randn( 10000, ); hist( y, x ) Bar chart x = -2.9:0.2:2.9; bar(x,exp(-x.*x)) Lineair 3-D plot t = 0:pi/50:10*pi; plot3( sin( t ), cos( t ), t ) grid on axis square Two-dimensional comet plot t = 0:.001:4*pi; x = sin(t); y = cos(t); comet(x,y); Three-dimensional comet plot t = -10*pi:pi/250:10*pi; comet3( sin( t ), cos(t), t); Exercises Oscillations; Circular motion Projectile motion ... 0 0 => Z = S3 + 6S2 + 16S + 16 Racine de polinome P=[1 -2 -5 ] R = roots(p) R= 2.0946 -1 .0473 + -1 .0473 - 1.1359i 1.1359i P=poly(R) P= -2 -5 Matrices B = [1 4; 8; 10 11 12] B=[1234 5678 10 11 12]... 'MarkerSize', 10 ) t = -pi:.1:pi; y = sin( t ); plot( t, y ) set( gca, 'XTick', -pi:pi/2:pi ) set( gca, 'XTickLabel', { '-pi', '-pi/2' , '0' , 'pi/2' , 'pi' } ) xlabel( '- pi leq alpha leq... x = -2 .9:0.1:2.9; y = randn( 10000, ); hist( y, x ) Bar chart x = -2 .9:0.2:2.9; bar(x,exp(-x.*x)) Lineair 3-D plot t = 0:pi/50:10*pi; plot3( sin( t ), cos( t ), t ) grid on axis square Two-dimensional