Vous êtes sur la page 1sur 6

Compte Rendu du TP2

Matlab : fait par WERZGAN


Youssef et CHOUHAD Hassan
Table of Contents
Exercice1: .........................................................................................................................
Exercice2 ..........................................................................................................................
Exercice3 ..........................................................................................................................
Exercice4: .........................................................................................................................
Exercice5 : ........................................................................................................................
Exercice 6: ........................................................................................................................

Exercice1:
clc;
clear;
%a
A=[1 10 4 -2;2 4 2 8;3 6 0 3;-5 7 1 9]
%b
v=A(:,2)
%c
w=A(2,:)
%d
B=A(:,2:4)
%e
C=A(2:4,:)
%f
D=A(1:2,2:4)

A =
1
2
3
-5

10
4
6
7

4
2
0
1

-2
8
3
9

v =
10
4
6
7

w =

1
2
3
4
5
5

Compte Rendu du TP2 Matlab : fait par WERZGAN


Youssef et CHOUHAD Hassan
2

10
4
6
7

4
2
0
1

-2
8
3
9

2
3
-5

4
6
7

2
0
1

10
4

4
2

-2
8

B =

C =
8
3
9

D =

Exercice2
clc;
clear;
A=[3 7 -4 12;-5 9 10 2;6 13 8 11;15 5 4 1];
%a
maxsdeA=max(A,[],1) % les maximums de chaque colonne
minsdeA=min(A,[],1)

% les minimums de chaque colonne

%b
maxsdeA=max(A,[],2)

% les maximums de chaque ligne

minsdeA=min(A,[],2)

% les minimums de chaque ligne

%c
B=sort(A)
%d
CA=sort(A')
C=CA'

Compte Rendu du TP2 Matlab : fait par WERZGAN


Youssef et CHOUHAD Hassan
maxsdeA =
15

13

10

12

-4

5
7
9
13

-4
4
8
10

1
2
11
12

-4
3
7
12

-5
2
9
10

6
8
11
13

1
4
5
15

-4
-5
6
1

3
2
8
4

7
9
11
5

12
10
13
15

minsdeA =
-5

maxsdeA =
12
10
13
15

minsdeA =
-4
-5
6
1

B =
-5
3
6
15

CA =

C =

Exercice3
clc;

Compte Rendu du TP2 Matlab : fait par WERZGAN


Youssef et CHOUHAD Hassan
clear;
A=[56 32;24 -16];
B=[14 -4;6 -2];
%a
Produit=A*B
%b
division=A\B
%c
elevation=B.^3

Produit =
976
240

-288
-64

division =
0.2500
0

-0.0769
0.0096

elevation =
2744
216

-64
-8

Exercice4:
clc;
clear;
R1=10; R2=40; R3=50; R4=20;
A=[1/R1+1/R4 -1/R1 -1/R4;-1/R4 -1/R2 1/R4+1/R2;1/R1 -(R1+R2+R3)/(R1*R2*R3) 1/R2];
B=[5 2 0]';
X= A\B % X=[V1 V2 V3]'

X =
-4.0476
-58.3333
4.5238

Compte Rendu du TP2 Matlab : fait par WERZGAN


Youssef et CHOUHAD Hassan

Exercice5 :
clc;
clear;
W=400;
Lb=3;
Lc=5;
D=0:0.1:Lb;
T=(Lb*Lc*W)./((D.*sqrt(Lb^2-D.^2)));
[Tmin,k]=min(T)
Dmin=D(1,k)

Tmin =
1.3336e+03

k =
22

Dmin =
2.1000

Exercice 6:
clc;
clear;
ug=220; w=2*pi*50; R1=10; R2=3; C=10^(-5); L=10^(-1);
I3=(ug/((i*w*(L+C*R1*R2))+R2+R1*(1-L*C*w^2)));
I2=((((i*C*w*R2)-(L*C*w^2))*ug)/(R1+R2+(i*L*w)+(i*C*w*R1)*(R2+i*L*w)));
I3effe=abs(I3)
phaseI3=angle(I3)*180/pi
I2effe=abs(I2)
phaseI2=angle(I2)*180/pi
I1=I2+I3;
I1effe=abs(I1)
phaseI1=angle(I1)*180/pi

I3effe =

Compte Rendu du TP2 Matlab : fait par WERZGAN


Youssef et CHOUHAD Hassan
6.5238

phaseI3 =
-69.1310

I2effe =
0.6468

phaseI2 =
105.4142

I1effe =
5.8803

phaseI1 =
-68.5319

Published with MATLAB R2013a

Vous aimerez peut-être aussi