evalm - Maple Programming Help

evalm

evaluate a matrix expression

 Calling Sequence evalm(matrix expression)

Parameters

 matrix expression - expression

Description

 • Important: The evalm command has been deprecated.  Matrix algebra expressions involving Matrices such as $A·B$ are evaluated directly, eliminating the need for the additional step of applying evalm.  For additional information, see Linear Algebra Computations in Maple.
 • The function evalm evaluates an expression involving matrices. It performs any sums, products, or integer powers involving matrices, and will map functions onto matrices.
 • Note that Maple may perform simplifications before passing the arguments to evalm, and these simplifications may not be valid for matrices. For example, evalm(A^0) will return 1, not the identity matrix.
 • Unassigned names will be considered either symbolic matrices or scalars depending on their use in an expression.
 • To indicate non-commutative matrix multiplication, use the operator &*. The matrix product ABC may be entered as $\left(A\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}&*\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}B\right)\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}&*\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}C$ or as $\mathrm{&*}\left(A,B,C\right)$, the latter being more efficient. Automatic simplifications such as collecting constants and powers will be applied. Do NOT use the * to indicate purely matrix multiplication, as this will result in an error. The operands of &* must be matrices (or names) with the exception of 0. Unevaluated matrix products are considered to be matrices. The operator &* has the same precedence as the * operator.
 • Use 0 to denote the matrix or scalar zero. Use $\mathrm{&*}\left(\right)$ to denote the matrix identity. It may be convenient to use alias(Id=&*()).
 • If a sum involves a matrix and a Maple constant, the constant will be considered as a constant multiple of the identity matrix. Hence matrix polynomials can be entered in exactly the same fashion as fully expanded scalar polynomials.

Examples

Important: The evalm command has been deprecated.  Matrix algebra expressions involving Matrices such as $A·B$ are evaluated directly, eliminating the need for the additional step of applying evalm.  For additional information, see Linear Algebra Computations in Maple.

 > $\mathrm{alias}\left(\mathrm{Id}=\mathrm{&*}\left(\right)\right):$
 > $S≔\mathrm{array}\left(\left[\left[1,2\right],\left[3,4\right]\right]\right):$
 > $T≔\mathrm{array}\left(\left[\left[1,1\right],\left[2,-1\right]\right]\right):$
 > $\mathrm{evalm}\left(S+2T\right)$
 $\left[\begin{array}{cc}{3}& {4}\\ {7}& {2}\end{array}\right]$ (1)
 > $\mathrm{evalm}\left({S}^{2}\right)$
 $\left[\begin{array}{cc}{7}& {10}\\ {15}& {22}\end{array}\right]$ (2)
 > $\mathrm{evalm}\left(\mathrm{sin}\left(S\right)\right)$
 $\left[\begin{array}{cc}{\mathrm{sin}}{}\left({1}\right)& {\mathrm{sin}}{}\left({2}\right)\\ {\mathrm{sin}}{}\left({3}\right)& {\mathrm{sin}}{}\left({4}\right)\end{array}\right]$ (3)
 > $\mathrm{evalm}\left(S\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}&*\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}T\right)$
 $\left[\begin{array}{cc}{5}& {-1}\\ {11}& {-1}\end{array}\right]$ (4)
 > $\mathrm{evalm}\left(\left(A\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}&*\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}B\right)\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}&*\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\left(2B\right)-B\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}&*\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathrm{Id}\right)$
 ${2}{}\left({A}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}{&*}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}{{B}}^{{2}}\right){-}{B}{}{\mathrm{Id}}$ (5)
 > $\mathrm{evalm}\left(\mathrm{&*}\left(A,B,0\right)\right)$
 ${0}$ (6)