Calcul matriciel
+ |
addition de matrices |
- |
soustraction de matrices |
* |
produit de matrices |
^ |
puissance |
eye (n)
|
matrice unité (matrice identité)
de taille n x n
|
inv (X) |
inverse de la matrice carrée X |
rank (X) |
rang de la matrice X (nombre de colonnes ou de lignes indépendantes) |
det (X) |
déterminant de la matrice carrée X |
X ' |
transposée de la matrice X |
/ |
division à droite : A / B est équivalent à A * inv(B) |
\ |
division à gauche : A \ B est équivalent à inv(A) * B |
Saisie d'une matrice carrée de taille 3 x 3 :
>> A = [ 2 4 5 ; 1 5 7 ; -3 3 1]
A =
2 4 5
1 5 7
-3 3 1
>> A(2 , 3)
ans =
7
>> A(2 , 3) = 6
A =
2 4 5
1 5 6
-3 3 1
>> A'
ans =
2 1 -3
4 5 3
5 6 1
>> inv(A)
ans =
1.0833 -0.9167 0.0833
1.5833 -1.4167 0.5833
-1.5000 1.5000 -0.5000
>> D = A * inv(A)
D =
1.0000 0.0000 0.0000
0.0000 1.0000 0.0000
0.0000 0.0000 1.0000
>> rank(A)
ans =
3
>> det(A)
ans =
-12
>> eye(7)
ans =
1 0 0 0 0 0 0
0 1 0 0 0 0 0
0 0 1 0 0 0 0
0 0 0 1 0 0 0
0 0 0 0 1 0 0
0 0 0 0 0 1 0
0 0 0 0 0 0 1
>> B = [ 1 1 0 ; 1 0 1 ; 0 1 1 ]
B =
1 1 0
1 0 1
0 1 1
>> A + B
ans =
3 5 5
2 5 7
-3 4 2
>> 2 + A
ans =
4 6 7
3 7 8
-1 5 3
>> 2 * A
ans =
4 8 10
2 10 12
-6 6 2
>> A * B
ans =
6 7 9
6 7 11
0 -2 4
>> B * A
ans =
3 9 11
-1 7 6
-2 8 7
>> A*A*A
ans =
-88 304 262
-98 314 268
-18 18 10
>> A^3
ans =
-88 304 262
-98 314 268
-18 18 10
Saisie d'une matrice à coefficients complexes de taille 2 x 3 :
>> C = [ 1 + i 0 0 ; 1 - i i 2]
C =
1.0000 + 1.0000i 0 0
1.0000 - 1.0000i 0 + 1.0000i 2.0000
>> C * A
ans =
2.0000 + 2.0000i 4.0000 + 4.0000i 5.0000 + 5.0000i
-4.0000 - 1.0000i 10.0000 + 1.0000i 7.0000 + 1.0000i
(C) Fabrice Sincère