Chapter 8. Matice v jazyce GEL

Table of Contents

Zadávání matic
Operátor konjugované transpozice a transpozice
Lineární algebra

Genius podporuje vektory a matice a jeho součástí je rozsáhlá knihovna pro práci s maticemi a s funkcemi lineární algebry.

Zadávání matic

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.

Another thing is that non-specified spots are initialized to 0, so

[1, 2, 3
 4, 5
 6]

will end up being

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

Když jsou matice vyhodnocovány, jsou vyhodnocovány a procházeny po řádcích. Je to úplně stejné jako operátor M@(j), který prochází matice po řádcích.

Note

Věnujte pozornost při vracení z výrazů uvnitř závorek [ ], protože tam mají lehce odlišný význam. Začnete tím nový řádek.