Operators > Matrix Operators > Index Operator
Index Operator
Returns or assigns the ith element of column vector v.
Returns or assigns the element in row i and column j of matrix M.
i, j are dimensionless integers.
v is a column vector.
M is a matrix.
Additional Information
The starting index for all vectors and matrices is determined by the ORIGIN built-in variable. You can set the index origin by changing the value of ORIGIN. The default value for ORIGIN is 0.
You can use the index operator to assign individual vector or matrix elements. If the index operands have been previously defined as range variables, you can use them to define an entire matrix.
You can create an m × n matrix by defining the bottom-right corner element with the index operator. For example:
This expression creates a 3 × 6 element matrix, filled with 0s except the last element, which is 13:
Was this helpful?