Comptes rendus ‘Matlab’ Les objectifs du TP1 : - apprendre à calculer les vecte
Comptes rendus ‘Matlab’ Les objectifs du TP1 : - apprendre à calculer les vecteurs ,les matrices ,les functions(plot ;fplot)par l’utilisation de Matlab . - Apprendre l’utilisation des M- files {les scripts, function} . - Savoire tracer le graphe d’une fonction . LES objectifs du TP2 : -apprendre calculer les racines des polynômes en MATLAB . -savoire utliser les boucles (for, while). -tracer la courbe d’une fonction du polynome RESOLUTION DES EXERCICES DU TP1: Exercice 1 : 1. >> a=1:7 a = 1 2 3 4 5 6 7 >> who Your variables are: a >> whos Name Size Bytes Class Attributes a 1x7 56 double 2. >> a=1:2 a = 1 2 3. >> b=a+2 b = 3 4 >> who Your variables are: a b >> whos Name Size Bytes Class Attributes a 1x2 16 double b 1x2 16 double Exercice 2 On écrit dans script : A=[12 24 36 58;2 6 8 10;7 9 11 13] A(3,:) A(:,4) A(2:3,2:3) A1=[7 9 11 13;2 6 8 10;12 24 36 58] Puis, nous cliquons sur Save pour l'enregistrer, puis sur Run et nous voyons dans commande Windows : A = 12 24 36 58 2 6 8 10 7 9 11 13 ans = 7 9 11 13 Ans = 58 10 13 ans = 6 8 9 11 A1 = 7 9 11 13 2 6 8 10 12 24 36 58 >> Exercice 3 : x= [0, 2, 4, 6,8,10,12,14,16] y= [20, 23,30,33,32,37,34, 39,36] plot(x,y) title('courbe de temperature') xlabel('temps') ylabel('temperature') grid on x = 0 2 4 6 8 10 12 14 16 y = 20 23 30 33 32 37 34 39 36 >> RESOLUTION DES EXERCICES DU TP2 : Exercice 3 x= input ('entrer la valeur de x=') if mod(x, 2) ==0 disp('le nombre est pair') else disp('le nombre est impair') end commande windows: entrer la valeur de x=3 x = 3 le nombre est impair >> Untitled entrer la valeur de x=2 x = 2 le nombre est pair Exercice 4: a = input('a=') b = input('b=') c = input('c=') if (a==0) if b~=0 x = -c/b else disp('l equation n a pas de solution') end else delta= b.^2-4.*a.*c if delta>0 disp('l equation a deux solution') x1=(-b+sqrt(delta))/2*a x2=(-b-sqrt(delta))/2*a elseif delta==0 disp('l equation a un seul solution') x= -b/2*a elseif delta<0 disp('l equation a deux solution complexe') x1 = (-b+i*sqrt(-delta))/2*a x2= (-b-i*sqrt(-delta))/2*a end end commande window: pour delta<0: a=2 a = 2 b=1 b = 1 c=4 c = 4 delta = -31 l equation a deux solution complexe x1 = -1.0000 + 5.5678i x2 = -1.0000 - 5.5678i Pour delta=0 : a=2 a = 2 b=4 b = 4 c=2 c = 2 delta = 0 l equation a un seul solution x = -4 Pour delta>0 : a=3 a = 3 b=4 b = 4 c=1 c = 1 delta = 4 l equation a deux solution x1 = -3 x2 = -9 uploads/Management/ matlab 3 .pdf
Documents similaires
![](https://b3c3.c12.e2-4.dev/disserty/uploads/preview/3Ok5iXPdgKAXf3iwJM8iEnWZ0AZ8UwLBD42Yr06hoaNX6mZkOP2yNuh6nREUg0Qo1BpGT8ncpCVyiAk9qCp8Bet4.png)
![](https://b3c3.c12.e2-4.dev/disserty/uploads/preview/UailGM1EWDkz3Y3YmvKaeQt5OpqQRWIa1Kdub3B8z6FQBbDYeCIbdQoZroUQI90m40vnaxhzOFgYvYdSowz05ghm.png)
![](https://b3c3.c12.e2-4.dev/disserty/uploads/preview/krE0mlC1MFSMgH31frsXq3OsgWXm6zersF9fXzJ6WZhxbQAjLI1Ht1PpizQHPauEIIjAwKns3yQcIs14ecWQC2G0.png)
![](https://b3c3.c12.e2-4.dev/disserty/uploads/preview/0DyKdnxkr9AsdD2JGKAbZ3RWvWIhO2ekw8NfNh26cW1xBOcWs2dTLbcskRY6vlcACG6LLVydNxux1bFKYEtLka3Y.png)
![](https://b3c3.c12.e2-4.dev/disserty/uploads/preview/845LjYWVdpRlEL573Cx6v3mRGvvbQWvPnuuup40Ll0m7GVREo7sdkjO7CqNtL2nwGNd6eXjiXurSDAMTCwqPINWX.png)
![](https://b3c3.c12.e2-4.dev/disserty/uploads/preview/d1wbMEGDlk2Lo1GbyojtIqxMSnBpiKRJgjVdCpbwYWRmoXpaQVYnjFP5SlJHWechhtVSuLlLBydFrgh9GODhcuJp.png)
![](https://b3c3.c12.e2-4.dev/disserty/uploads/preview/7tyNW20bGVlUJgoRrf8yKB9V8w65XTuM94zhl2Rg4gO2ZDvbqSqZJhxjGxXKIo12wuHLYeDN4cEQR5QfE0GGoTPF.png)
![](https://b3c3.c12.e2-4.dev/disserty/uploads/preview/uMc46zwyyxSGbxxMSFHviDI7bFJLH4oinRuaSBj9W10PdSoiXFUPis0zC332SYhJkTFffL6JCtRFyeybUE7Eu6hi.png)
![](https://b3c3.c12.e2-4.dev/disserty/uploads/preview/tLGJUlJvjuLgoqjryT5AH8QVjadtOSLe0x8oawxbooGmN6MxrU8l7cbvtNltJJqBwFFM8dhhec9iEGo9mSeQpgzV.png)
![](https://b3c3.c12.e2-4.dev/disserty/uploads/preview/sTlb5A0UJ4yl0WDVlzvvOJbWTvSceGWMyy0OPQqW0qRsrfH2vTollvLWQIq6qb6DpZZ8L8R2nqYCzrVuymnNDHkq.png)
-
23
-
0
-
0
Licence et utilisation
Gratuit pour un usage personnel Attribution requise- Détails
- Publié le Jul 13, 2021
- Catégorie Management
- Langue French
- Taille du fichier 0.2884MB