Sunteți pe pagina 1din 1

Exercice1

c=1
for mu= [2,0]
for sigma= [0.2,0.5,1,5]
l=1
for x= [-5:0.1:5]
stock(l,c)=(1/sigma*sqrt(2*pi))*exp(-0.5*(x-mu/sigma)^2)
% stock(l,c)=(1/sigma*sqrt(2*pi))*exp(-0.5*((-5:0.1:5)-mu/sigma).^2)

l=l+1;
end
c=c+1;
end
end
% le maximum
maxi=max(stock)
% tri et moyen
tri=sort(maxi)
maxisupmoy=maxi(find(maxi>mean(maxi)))
%
couleur=['r','g','y','m','c','b','k','*m'];
for k=1:8
plot(-5:0.1:5,stock(:,k),couleur(k))
hold on
end
hold off
legend(' \mu=-2 \sigma=0.2',' \mu=-2 \sigma=0.5',' \mu=-2 \sigma=1',' \mu=-
2 \sigma=5',' \mu=0 \sigma=0.2',' \mu=0 \sigma=0.5',' \mu=0 \sigma=1','
\mu=0 \sigma=5',-1)

xlabel('valeur de x entre -5 et 5')


ylabel('le vecteur stock')
exercice2

function [ hmax,dmax,trajet] = trajectoire(v0,theta)


g=9.81
theta=theta*pi/180;
hmax=(v0*sin(theta))^2/2*g;
dmax=(2*tan(theta)*(v0*cos(theta))^2)/g;

for x=0:0.2:dmax
trajet=-g/(2*(v0*cos(theta))^2)*x^2+tan(theta)*x;
plot(x,trajet,'*r')
hold on
end
hold off

S-ar putea să vă placă și