Chapitre 8. Matrices en GEL

Table des matières

Saisie de matrices
Opérateur de transposition conjuguée et de transposition
Algèbre linéaire

Genius has support for vectors and matrices and possesses a sizable library of matrix manipulation and linear algebra functions.

Saisie de matrices

To enter matrices, you can use one of the following two syntaxes. You can either enter the matrix on one line, separating values by commas and rows by semicolons. Or you can enter each row on one line, separating values by commas. You can also just combine the two methods. So to enter a 3x3 matrix of numbers 1-9 you could do

[1,2,3;4,5,6;7,8,9]

or

[1, 2, 3
 4, 5, 6
 7, 8, 9]

Do not use both ';' and return at once on the same line though.

You can also use the matrix expansion functionality to enter matrices. For example you can do:

a = [ 1, 2, 3
      4, 5, 6
      7, 8, 9]
b = [ a,  10
      11, 12]

and you should get

[1,   2,  3, 10
 4,   5,  6, 10
 7,   8,  9, 10
 11, 11, 11, 12]

similarly you can build matrices out of vectors and other stuff like that.

Notez que les éléments non spécifiés sont initialisés à 0, donc

[1, 2, 3
 4, 5
 6]

donne au final

[1, 2, 3
 4, 5, 0
 6, 0, 0]

When matrices are evaluated, they are evaluated and traversed row-wise. This is just like the M@(j) operator, which traverses the matrix row-wise.

Note

Faites attention lorsque vous utilisez des retours à la ligne à l'intérieur des crochets [ ] car ils ont une signification légèrement différente dans ce cas. Vous commencez une nouvelle ligne.