MATRIXDEF: Difference between revisions

From iMath
Jump to navigation Jump to search
mNo edit summary
mNo edit summary
 
Line 10: Line 10:


The second form is a shortcut for the combination of <code>MATRIXDEF</code> and <code>[[EQDEF]]</code>. It defines the symbol and creates an equation defining its value.
The second form is a shortcut for the combination of <code>MATRIXDEF</code> and <code>[[EQDEF]]</code>. It defines the symbol and creates an equation defining its value.
Note that the matrix symbol is not identical with another symbol that has the same name but a different commutativity. To avoid confusion, always define your symbols as matrices before you use them for the first time.
|
|
3=
3=

Latest revision as of 20:41, 21 February 2025

Syntax

MATRIXDEF symbol

@label@ { options } MATRIXDEF [*] symbol = expression

Implemented in iMath since version 2.2.0 or earlier.

Explanation

Declares the symbol to be a (two-dimensional) matrix. This is important because matrices are non-commutative when evaluating an expression.

The second form is a shortcut for the combination of MATRIXDEF and EQDEF. It defines the symbol and creates an equation defining its value.

Note that the matrix symbol is not identical with another symbol that has the same name but a different commutativity. To avoid confusion, always define your symbols as matrices before you use them for the first time.

Example

MATRIXDEF M

@matrix@ MATRIXDEF M = left(MATRIX{ a # b # c ## d # e # f ## g# h# i }right)

Declares two matrices M and N and assigns a value to N. In expression evaluation, iMath will treat the matrices as non-commutative, that is, M N ≠ N M.

See also

VECTORDEF