Contents Previous Next Subchapters

Using a Matrix as an Index (Mlmode)
Syntax x(index)
O-Matrix Mode vector indices

Description
Indices can be vectors or matrices in Mlmode. If an index is a matrix it is interpreted as if it were the vector corresponding to column major ordering of the index matrix.

Example
If in Mlmode you enter
     x = [ 0 1 2 3 4 5 6 ];
     y = [ 1 2 ; 3 4 ];
     x(y)
O-Matrix will respond
     [ 0 , 1 , 2 , 3 ]
If the matrix being indexed is not a vector, the result has the same dimension as the index matrix. If you continue the example above by entering
     x = [ 0 1 2 ; 3 4 5 ; 6 7 8 ];
     x(y)
O-Matrix will respond
     {
     [ 0 , 3 ]
     [ 6 , 1 ]
     }