Contents Previous Next Subchapters

Loading And Storing Matrices As Vectors
Syntax matrix(:)
See Also vector indices , dim ,

Description
Treats a matrix as if it were a column vector in column major order; i.e., its first column followed by its second and so on.

Tutorial
If you enter
     x = {[ 1 , 2 ], [ 3 , 4 ]}
     print x(:)
O-Matrix will respond
     {
     1
     3
     2
     4
     }
Using the colon notation, you can store one matrices elements in another matrix so long as they have the same number of elements. If you continue by entering
     x(:) = { 1, 2, 3, 4 }
     print x
O-Matrix will respond
     {
     [ 1 , 3 ]
     [ 2 , 4 ]
     }