MuPAD® notebooks are not recommended. Use MATLAB® live scripts instead.
MATLAB live scripts support most MuPAD functionality, though there are some differences. For more information, see Convert MuPAD Notebooks to MATLAB Live Scripts.
Linear transformations are operations that matrices perform
on vectors. An eigenvalue and eigenvector of a square matrix
respectively, a scalar λ and
a nonzero vector such
Typically, if a matrix changes the length of a vector, but does not change its direction, the vector is called an eigenvector of the matrix. The scaling factor is the eigenvalue associated with this eigenvector.
MuPAD® provides the functions for computing eigenvalues and eigenvectors. For example, create the following square matrix:
A := matrix([[1, 2, 3], [4, 5, 6], [1, 2, 3]])
To compute the eigenvalues of the matrix
returns a set of eigenvalues.
A set in MuPAD cannot contain duplicate elements. Therefore,
if a matrix has eigenvalues with multiplicities greater than 1, MuPAD automatically
removes duplicate eigenvalues. If you want the
linalg::eigenvalues function to return
eigenvalues along with their multiplicities, use the
For example, zero is a double eigenvalue of the matrix
To compute the eigenvectors of a matrix, use the
The function returns eigenvectors along with corresponding eigenvalues
and their multiplicities:
computes eigenvalues of a matrix by finding the roots of the characteristic
polynomial of that matrix. There is no general method for solving
polynomial equations of orders higher than 4. When trying to compute
eigenvalues of a large matrix, the solver can return complicated solutions
or solutions in the form of
RootOf. Also, the solver can fail to
find any solutions for some matrices. For example, create the 6
×6 Pascal matrix:
P := linalg::pascal(6)
For that matrix, MuPAD finds eigenvalues in the form of
eigenvalues := linalg::eigenvalues(P)
You can find floating-point approximation of the result by using
For more information about approximating eigenvalues and eigenvectors numerically, see Numeric Eigenvalues and Eigenvectors.