Contents Previous Next Subchapters

Automatic Growing of Matrices on Assignment (Mlmode)
Syntax x(index) = expression
x(rowcolumn) = expression
O-Matrix Mode indices

Description
If you assign to an index that does not exist, the matrix will grow to be just large enough to include the new index. The undefined entries in the larger matrix are initialized to zero.

Example

One Index
If in Mlmode you enter
     x = [ 1 2 ];
     x(4) = 4
O-Matrix will reply
     x = [ 1 , 2 , 0 , 4 ]

Two Indices
If enter
     x = [ 1 2 0 4 ];
     x(2, 2) = 4
O-Matrix will reply
     {
     [ 1 , 2 , 0 , 4 ]
     [ 0 , 4 , 0 , 0 ]
     }

By Rows
If in Mlmode you enter
     x      = 1;
     x(3,:) = 3
O-Matrix will reply
     {
     1
     0
     3
     }

By Columns
If in Mlmode you enter
     x      = 1;
     x(:,3) = 3
O-Matrix will reply
     [ 1 , 0 , 3 ]