Indiana University
University Information Technology Services
  
What are archived documents?
Login>>
Login

Login is for authorized groups (e.g., UITS, OVPIT, and TCC) that need access to specialized Knowledge Base documents. Otherwise, simply use the Knowledge Base without logging in.

Close

In Maple, Mathematica, and Matlab, how do I obtain eigenvalues and eigenvectors?

Maple

In Maple, the command to obtain eigenvalues and eigenvectors is:

eigenvects( map(evalf, A) )

For example:

> with(linalg): > A := matrix( [ [10, 0, 1], [0, 5, 1], [1, 1, 3] ] ); [ 10 0 1 ] [ ] A := [ 0 5 1 ] [ ] [ 1 1 3 ] > eigsys := eigenvects( map(evalf, A) ); eigsys := [2.471653325, 1, { [-.1225891913, -.3650187460, .9228939292]} ], [10.14389544, 1, { [ .9894258912, .02767822018, .1423738801]} ], [5.384451215, 1, { [.07751319726, -.9305886462,-.3577659480]} ] > eigsys[2][3][1][3]; .1423738801

Mathematica

In Mathematica, use:

{d,v} = Eigensystem[N[a]]

For example:

In[1]:= a = {{10., 0, 1}, {0, 5, 1}, {1, 1, 3}} Out[1]= {{10., 0, 1}, {0, 5, 1}, {1, 1, 3}} In[2]:= eigsys = Eigensystem[N[a]] Out[2]= { {10.1439, 5.38445, 2.47165}, > { {-0.989426,-0.0276782, -0.142374}, > {0.0775132, -0.930589, -0.357766}, > { 0.122589, 0.365019, -0.922894} } } In[3]:= eigsys[[2,1,3]] Out[3]= -0.142374

Matlab

In Matlab, use:

[V,D] = eig(A)

For example:

>> A = [ 10., 0, 1; 0, 5, 1; 1, 1, 3 ] A = 10 0 1 0 5 1 1 1 3 >> [V,D] = eig(A); >> [V,D] = eig(A) V = 0.9894 0.0775 -0.1226 0.0277 -0.9306 -0.3650 0.1424 -0.3578 0.9229 D = 10.1439 0 0 0 5.3845 0 0 0 2.4717 >> V(3,1) ans = 0.1424

For more information about statistical and mathematical software, email the UITS Stat/Math Center, visit the center's web page, or phone 812-855-4724 (IUB) or 317-278-4740 (IUPUI). The center is located in Bloomington at 410 N. Park Avenue, and is open for consultation by appointment Monday-Friday 9am-5pm.

This is document afko in domain all.
Last modified on March 31, 2009.

Comments/Questions/Corrections

Use this form to offer suggestions, corrections, and additions to the Knowledge Base. We welcome your input!

If you are affiliated with Indiana University and would like assistance with a specific computing problem, please use the Ask a Consultant form, or contact your campus Support Center.

Contact Information

Note: We will reply to your comment at this address. If your message concerns a problem receiving email, please enter an alternate email address.