Finding Eigenvalues and Eigenvectors in Octave

Description

The eig function in Octave calculates eigenvectors and eigenvalues. The following cell calculates the eigenvalues of the matrix

(1)
\begin{align} A = \begin{pmatrix} 1 & 3 & 3 \\ 3 & -3 & 1 \\ 4 & 1 & 4 \end{pmatrix}. \end{align}

Sage Cell

Code

A=[1 3 3; 3 -3 1; 4 1 4];
eig(A)

Options

Option

In order to obtain the eigenvectors, you need to provide two variables for the answer. The column of the matrix V are the eigenvectors. The eigenvalues are now in the diagonal matrix D. Notice that $VDV^{-1}$ recovers the original matrix.
.

Code

A=[1 3 3; 3 -3 1; 4 1 4];
[V, D] = eig(A)
V*D*inv(V)

Tags

Primary Tags:

Secondary Tags:

Related Cells

Attribute

Permalink:

Author:

Date: 10 Dec 2018 16:10

Submitted by: Tom Judson

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License