Contents Previous Next Subchapters

Assigning Values To Variables
Syntax variable = value
See Also multiple assignment , functions as variables , constants

Description
Assigns a value to the specified variable.

Tutorial
The assignment statement sets a variable equal to a value. The variable takes the type and dimension of the value assigned to it.

Scalars
If you enter
     x = 42
     print x
O-Matrix will respond
     42

Row Vectors
If you enter
     x = [2, 3, .2]
     x
O-Matrix responds
     [ 2 , 3 , 0.2 ]

Column Vectors
If you enter
     x = {2, 3, .2}
     x
O-Matrix responds
     {
     2
     3
     0.2
     }

Matrices
Entering
     x = {[1, 2], [0, 1]}
     x
yields
     {
     [ 1 , 2 ]
     [ 0 , 1 ]
     }