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

Exercice 1 :

a)A=[1,-4,-1,1;1,7,1,-2;1,4,-1,2;3,-10,-2,5]

A =

1 -4 -1 1
1 7 1 -2
1 4 -1 2
3 -10 -2 5

b)B1=[4,-1;10,-2]

B1 =

4 -1
10 -2

B2=[1,-4,-1;1,7,1;1,4,-1]
B2 =

1 -4 -1
1 7 1
1 4 -1

c)A=[3,2]
A =

3 2

A=[2:4,3]
A =

2 3 4 3

A=[3,:]
A = 3

tril(A)
ans =

1 0 0 0
1 7 0 0
1 4 -1 0
3 -10 -2 5

d)D=eye(4)-A*A'
D =

-18 30 12 -50
30 -54 -24 79
12 -24 -21 25
-50 79 25 -137

e)

Exercice 2:
1) a_ M=[1,2,3;-1,0,-3;0,2,4]
M =

1 2 3
-1 0 -3
0 2 4

b) M(2:2,1:3)
ans =

-1 0 -3

c) M(1:3,3:3)
ans =

3
-3
4

2)a_ D=M'
D =

1 -1 0
2 0 2
3 -3 4

b) D=ones(4,4)*zeros(4,4)
D =

0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0

c) D=diag(M)
D =

1
0
4

Exercice 3:
a) M=[2,12,3;3,-10,-3;4,2,45]
M =

2 12 3
3 -10 -3
4 2 45

b) determinant: det(M)
ans = -2514

inverse: inv(M)
ans =

1.7661e-01 2.1241e-01 2.3866e-03


5.8473e-02 -3.1026e-02 -5.9666e-03
-1.8298e-02 -1.7502e-02 2.2275e-02
Exercice 4 :

You might also like