Obtain eigenvalues and eigenvectors in Maple, Mathematica, and MATLAB

Maple

In Maple, in the LinearAlgebra package, the command to obtain eigenvalues and eigenvectors for the matrix A is:

  Eigenvectors(A)

For example:

  > with(LinearAlgebra): 
  > A:=<1, 2; 6, -1>;
       [1     2]
  A := [       ]
       [6    -1]
  > v,e:=Eigenvectors(A);
         [  1/2 ]  [    2            2     ]
         [13    ]  [---------    ----------]
  v, e := [      ], [  1/2           1/2    ]
         [   1/2]  [13    - 1    -13    - 1]
         [-13   ]  [                       ]
                   [    1            1     ]
  > evalf(v);
  [3.605551275 ]
  [            ]
  [-3.605551275]

Mathematica

In Mathematica, use:

  {v, e} = Eigensystem[A] 

For example:

In[1]:= A = {{1, 2}, {6, -1}}                                             

Out[1]= {{1, 2}, {6, -1}}

In[2]:= {v, e} = Eigensystem[A]                                           

                                  1 - Sqrt[13]       1 + Sqrt[13]
Out[2]= {{-Sqrt[13], Sqrt[13]}, {{------------, 1}, {------------, 1}}}
                                       6                  6

In[3]:= N[v]                                                              

Out[3]= {-3.60555, 3.60555}

MATLAB

In MATLAB, use:

  [e,v] = eig(A)

For example:

>> A=[1, 2; 6, -1]
A =
     1     2
     6    -1
>> [e v]=eig(A)
e =
    0.6089   -0.3983
    0.7933    0.9172
v =
    3.6056         0
         0   -3.6056
>> v
v =
    3.6056         0
         0   -3.6056

If you have questions about using statistical and mathematical software at Indiana University, contact Research Analytics.

Related documents

This is document afko in the Knowledge Base.
Last modified on 2019-01-31 15:37:04.

Contact us

For help or to comment, email the UITS Support Center.