Contents Previous Next Subchapters Current Chapters-> mlmode_assignment multiplestatement mlmode_same mlmode_if mlmode_for mlmode_while mlmode_colon mlmode_numbers mlmode_building mlmode_character mlmode_quote mlmode_matrixdivision mlmode_logicalop mlmode_numericop mlmode_realpart mlmode_matrixindex mlmode_logicalindex mlmode_grow Parent Chapters-> Omatrix6 mlmode mlmode_language mlmode_matrixindex Search Tools-> contents reference index search

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 ]      } ```