Matrix/Vector Object

This is a vector
There are 3 items inside.
To create such object, press [
and entrer : [1 2 3].
This is a 2x2 matrix

To create such object, press [
and enter : [[1 2][3 4]].
Matrix and vector content can be any kind of object, even if it look strange to you, you can have matrix of string, matrix of vector, of what you want.
Usualy you can works with matrix of complex.


General Operations

function usage example
DET Compute the determinant of a matrix [[1 2][3 4]] gives -2
tr transpose a matrix/vector [1 2] gives [[1][2]]
[[1 2]] gives [[1][2]]
[[1][2]] gives [[1 2]]
[[1 2][3 4]] gives [[1 3][2 4]]
GET Extract an item / a full row / a full column of a matrix

use list as parameters : {col row}
row=0 means "the full row"
[[1 2][3 4]] {2 2} gives 4.   the item at x=2,y=2
[[1 2][3 4]] {2 0} gives [[2][4]].  2nd col
[[1 2][3 4]] {0 2} gives [[3 4]].  2nd row
trace compute the trace
egvl give a list of eigen values
comat compute the comatrix
1/x compute inverse of a matrix
RndMX to get random matrix
ID to build an identity matrix
Vectangle
[]->
[]->{}
->[]
{}->[]
dim
PrdScal
PrdVect (cross)





Basic Operations

Of course you can perform add+, subs-, mult*.. with matrix.
Division/ is a little bit special : it can be used to result an equation system.
3*x + 2*y + 1*z = 20
6*x + 0*y - 7*z = 15
5*x - 2*y + 4*z = -10
can be noted as : [[A]]*[[X]] = [[B]]

[[A]] is [[X]] is [[B]] is
[[3 2 1]
 [6 0 -7]
 [5 -2 4]]
[[x]
 [y]
 [z]]
[[20]
 [15]
 [-10]]
If [[A]]*[[X]] = [[B]], you can have [[X]] by calculating [[A]]-1 (inverse).
Now the equation system result ([[X]]) is [[A]]-1*[[B]].
In RPNEnh you can note it as [[B]]/[[A]]. So this is exactly what do perform / :

Example :

enter the [[B]] matrix : [20 15 -10] (in fact you should enter [[20][15][-10]] but it's the same)
now the [[A]] matrix : [[3 2 1][6 0 -7][5 -2 4]]
now press divide operator : /
you have the result ! x=1.6860 y=7.8197 z=-0.6976

Please note that dividing matrix is not usually permited.
because [[B]]/[[A]] has two possible notations : [[A]]-1*[[B]] and [[B]]*[[A]]-1, these notation are not equal !
by using /, RPNenh will use [[A]]-1*[[B]].
If you really want to be sure about what you are doing, you must perform INV and then *.




--UNDER CONSTRUCTION --
Last change : 6th of Oct 2003.

Change : new style 14th Dec 03