Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

08/11/15 08:26 C:\Users\AMERAOUI\Documents\MATLAB\TP2.

m 1 of 1

% TP2: Graphisme 2D & 3D


% APPLICATION 1:
fplot('[cos(x),x^2*cos(x)]',[-3*pi/2,3*pi/2,-14,4]), grid
% APPLICATION 2:
% 1)
t=0:0.05:2;
C=12*exp(-2*t)-8*exp(-6*t);
plot(t,C,'rd-.'),xlabel('Temps (min)'),ylabel('Concentration (g/l)')
title('Evolution de la concentration en fonction du temps'),grid
% 2)
x1=1:10:1000;
y1=x1.^3;
loglog(x1,y1),grid
% APPLICATION 3:
[X,Y]=meshgrid(-1:0.1:1,-1:0.1:1);
Z=(X-1).^2+10*((X.^2-Y).^2);
[C,h]=contour(X,Y,Z,30);grid
clabel(C,h,'manual')
mesh(X,Y,Z)
meshc(X,Y,Z)
% APPLICATION 4:
subplot(2,2,1),fplot('cos',[-2*pi,2*pi]),xlabel('x'),ylabel('y'),title('Cosinus'),grid
subplot(2,2,2),fplot('acos',[-1,1]),xlabel('x'),ylabel('y'),title('Arc-Cosinus'),grid
subplot(2,2,3),fplot('sin',[-2*pi,2*pi]),xlabel('x'),ylabel('y'),title('Sinus'),grid
subplot(2,2,4),fplot('asin',[-1,1]),xlabel('x'),ylabel('y'),title('Arc-Sinus'),grid

You might also like