jeudi 12 avril 2012

exercice en matlab

1-Traçage du polynome Pn(x)=x3-30x+30, dans l’intervalle                                                                                               [-8,8], Avec un pas de 0,1: Programme :

%Traçage du polynome Pn(x)=x3-30x+30 :
P=input('Donner le Pas : P= ')
x=-8:P:8
pn=[1 0 -30 30];
y=polyval(pn,x);
figure
plot(x,y,'r');
xlabel('x');
ylabel('y');
grid;
title('Polynome pn(x)');

          Programme :


Après l’execution de ce programme on obtient le graphe suivant :
































Aucun commentaire:

Enregistrer un commentaire