M is a real or complex matrix. If the matrix is square, it must be non-singular.
v is a real or complex vector or matrix having the same number of rows as M.
Notes:
A matrix is singular if its determinant is 0. It is nearly singular if it has a high condition number. These conditions make it difficult to compute the inverted matrix used to solve the problem. The lsolve function may fail or may produce meaningless results in these cases. You may wish to use other decompositions for nearly singular matrices.
Another test for a system with a unique solution is to check if rank(M) = cols(M), that is, if all the columns of M are linearly independent.
You can use matrix inversion directly to solve this type of system, but lsolve is faster, and, in some cases, more accurate. To solve a linear system of equations in natural notation, you may wish to use a Solve Block.
In the case of an inconsistent system of equations, lsolve returns the least-squares solution, given also by geninv(M)·v.
For matrix values of v, lsolve(M,v<i>) returns the ith column of geninv(M)·v.
More information on lsolve, including its use in under- and over-constrained systems can be found in the E-book Inside Mathcad: Solving and Optimization, available from the Mathcad download site.