Difference between revisions of "MATRIXDEF"

From iMath
Jump to: navigation, search
(Created page with "{{Keyword | 1= <code>MATRIXDEF symbol</code> <code>@label@ { options } MATRIXDEF [*] symbol = expression</code> | 2= Defines the symbol to be a (two-dimension...")
 
m
 
(2 intermediate revisions by the same user not shown)
Line 7: Line 7:
 
|
 
|
 
2=
 
2=
Defines the symbol to be a (two-dimensional) matrix. This is important because matrices are non-commutative when evaluating an expression.
+
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 <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.
Line 14: Line 14:
 
<code>MATRIXDEF M</code>
 
<code>MATRIXDEF M</code>
  
<code>MATRIXDEF N = MATRIX{ a # b # c ## d # e # f ## g# h# i }</code>
+
<code>@matrix@ MATRIXDEF M = left(MATRIX{ a # b # c ## d # e # f ## g# h# i }right)</code>
  
Defines two matrices <code>M</code> and <code>N</code> and assigns a value to <code>N</code>. In expression evaluation, iMath will treat the matrices as non-commutative, that is, <code>M N &ne; N M</code>.
+
Declares two matrices <code>M</code> and <code>N</code> and assigns a value to <code>N</code>. In expression evaluation, iMath will treat the matrices as non-commutative, that is, <code>M N &ne; N M</code>.
 +
|
 +
4=
 +
[[VECTORDEF]]
 
}}
 
}}
[[Category:Definition]]
+
[[Category:Declaration]][[Category:Definition]]

Latest revision as of 16:35, 4 January 2023

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.

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