mldivide - Maple Help

# Online Help

###### All Products    Maple    MapleSim

MTM

 mldivide
 left matrix division

 Calling Sequence mldivide(A,B)

Parameters

 A - matrix, vector, array, or scalar B - matrix, vector, array, or scalar

Description

 • If A is a square matrix and B is a matrix, then mldivide(A,B) computes X, where X is the solution to the matrix equation A * X=B.
 • If A is a non-square matrix and B is a matrix, then mldivide(A,B) computes X, where X is a solution to the linear system A * X=B, in the least squares sense.
 • Maple normally treats arrays and vectors as distinct from matrices, in some cases not permitting a matrix operation when the given argument is not specifically declared as a matrix.  This function implicitly extends arrays and vectors to 2 dimensions.  Notably, n-element column vectors are treated as n x 1 matrices.  Also, n-element row vectors and 1-D arrays are treated as 1 x n matrices.
 • If A is a scalar, then mldivide(A,B) computes ldivide(A,B).
 • If B is a scalar, then mldivide(A,B)  is computed as if B is a 1 x 1 matrix.

Examples

 > $\mathrm{with}\left(\mathrm{MTM}\right):$
 > $A≔\mathrm{Matrix}\left(\left[\left[1,2,1\right],\left[4,5,6\right],\left[2,8,1\right]\right]\right)$
 ${A}{≔}\left[\begin{array}{ccc}{1}& {2}& {1}\\ {4}& {5}& {6}\\ {2}& {8}& {1}\end{array}\right]$ (1)
 > $B≔\mathrm{Vector}\left[\mathrm{column}\right]\left(\left[8,32,21\right]\right)$
 ${B}{≔}\left[\begin{array}{c}{8}\\ {32}\\ {21}\end{array}\right]$ (2)
 > $\mathrm{mldivide}\left(A,B\right)$
 $\left[\begin{array}{c}{1}\\ {2}\\ {3}\end{array}\right]$ (3)
 > $A≔\mathrm{Matrix}\left(\left[\left[1,2,1\right],\left[4,5,6\right],\left[2,8,1\right]\right]\right)$
 ${A}{≔}\left[\begin{array}{ccc}{1}& {2}& {1}\\ {4}& {5}& {6}\\ {2}& {8}& {1}\end{array}\right]$ (4)
 > $B≔\mathrm{Matrix}\left(\left[\left[8,20,32\right],\left[32,77,122\right],\left[21,54,87\right]\right]\right)$
 ${B}{≔}\left[\begin{array}{ccc}{8}& {20}& {32}\\ {32}& {77}& {122}\\ {21}& {54}& {87}\end{array}\right]$ (5)
 > $\mathrm{mldivide}\left(A,B\right)$
 $\left[\begin{array}{ccc}{1}& {4}& {7}\\ {2}& {5}& {8}\\ {3}& {6}& {9}\end{array}\right]$ (6)
 > $A≔\mathrm{Matrix}\left(\left[\left[1,2,1\right],\left[4,5,6\right]\right]\right)$
 ${A}{≔}\left[\begin{array}{ccc}{1}& {2}& {1}\\ {4}& {5}& {6}\end{array}\right]$ (7)
 > $B≔\mathrm{Vector}\left[\mathrm{column}\right]\left(\left[8,32\right]\right)$
 ${B}{≔}\left[\begin{array}{c}{8}\\ {32}\end{array}\right]$ (8)
 > $\mathrm{mldivide}\left(A,B\right)$
 $\left[\begin{array}{c}\frac{{52}}{{31}}\\ \frac{{56}}{{31}}\\ \frac{{84}}{{31}}\end{array}\right]$ (9)
 > $A≔\mathrm{Matrix}\left(\left[\left[1,2,1\right],\left[4,5,6\right]\right]\right)$
 ${A}{≔}\left[\begin{array}{ccc}{1}& {2}& {1}\\ {4}& {5}& {6}\end{array}\right]$ (10)
 > $B≔\mathrm{Matrix}\left(\left[\left[8,20,32\right],\left[32,77,122\right]\right]\right)$
 ${B}{≔}\left[\begin{array}{ccc}{8}& {20}& {32}\\ {32}& {77}& {122}\end{array}\right]$ (11)
 > $\mathrm{mldivide}\left(A,B\right)$
 $\left[\begin{array}{ccc}\frac{{52}}{{31}}& {4}& \frac{{196}}{{31}}\\ \frac{{56}}{{31}}& {5}& \frac{{254}}{{31}}\\ \frac{{84}}{{31}}& {6}& \frac{{288}}{{31}}\end{array}\right]$ (12)

 See Also