calculate jordan form in matlab

To calculate the Jordan form of a matrix in Matlab, we first need to find the eigenvectors of the matrix. We can then use these eigenvectors to form the matrix P, which will be used in the eigendecomposition of the matrix. The Jordan form can be found by carrying out a similarity transformation on the matrix using the eigenvectors.

Here's an example code snippet that calculates the Jordan form of a given matrix A:

main.m
% define matrix A
A = [1 1; 0 1];

% calculate eigenvectors and eigenvalues
[V, D] = eig(A);

% construct matrix P from eigenvectors
P = [V(:,2) V(:,1)];

% carry out similarity transformation to find Jordan form
J = inv(P)*A*P;
disp(J); % display Jordan form
260 chars
13 lines

In this example, we define a simple 2x2 matrix A and calculate its eigenvectors (V) and eigenvalues (D) using the eig function. We then construct the matrix P from the eigenvectors, with the second column of V corresponding to the first eigenvector and the first column of V corresponding to the second eigenvector. Finally, we carry out the similarity transformation to find the Jordan form J of the matrix A.

gistlibby LogSnag