0% found this document useful (0 votes)
16 views

matlab13

Uploaded by

ABHAY THAKUR
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views

matlab13

Uploaded by

ABHAY THAKUR
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Experiment: Computing Eigenvalues for a Matrix in MATLAB

Objective

To compute the eigenvalues of a matrix using MATLAB and understand their significance in linear
algebra.

Theory

Eigenvalues are scalar values associated with a square matrix, where the matrix, when multiplied by
a vector (called an eigenvector), results in the same vector scaled by the eigenvalue. This can be
represented mathematically as:

A⋅v=λ⋅v

Where:

 A: Square matrix

 v: Eigenvector

 λ: Eigenvalue

Eigenvalues are useful in various applications, including stability analysis, vibration analysis, and
principal component analysis (PCA).

In MATLAB, the eig function is used to compute the eigenvalues of a matrix.

Materials Required

 MATLAB Software

 A computer system with MATLAB installed

Procedure

1. Define a Square Matrix: Create or input a square matrix AAA for which eigenvalues will be
computed.

A = [4, -2; 1, 1];

2. Compute Eigenvalues: Use the eig function to compute the eigenvalues of the matrix AAA.

eigenvalues = eig(A);

3. Verify Results: Verify the eigenvalues by solving the characteristic equation det(A−λI)=0.

syms lambda;

char_eq = det(A - lambda * eye(size(A)));

solve(char_eq, lambda);

4. Analyze Eigenvectors (Optional): Compute the eigenvectors along with eigenvalues.

[V, D] = eig(A);
5. Repeat with Different Matrices: Experiment with matrices of different sizes and elements,
including symmetric and non-symmetric matrices.

Observations

Eigenvectors
Matrix AAA Eigenvalues (λ\lambdaλ)
(vvv)
[4−211]\begin{bmatrix} 4 & -2 \\ 1 & 1 \ λ1=3,λ2=2\lambda_1 = 3, \ Calculated by
end{bmatrix}[41−21] lambda_2 = 2λ1=3,λ2=2 eig
[2003]\begin{bmatrix} 2 & 0 \\ 0 & 3 \ λ1=2,λ2=3\lambda_1 = 2, \
Diagonal matrix
end{bmatrix}[2003] lambda_2 = 3λ1=2,λ2=3

Conclusion

The eigenvalues of a matrix provide critical insights into its properties and behaviors, such as stability
and transformations. MATLAB's eig function simplifies eigenvalue computation, and symbolic
verification ensures accuracy.

Code

matlab

Copy code

% Define a square matrix

A = [4, -2; 1, 1];

% Compute eigenvalues

eigenvalues = eig(A);

disp('Eigenvalues of the matrix:');

disp(eigenvalues);

% Verify results symbolically

syms lambda;

char_eq = det(A - lambda * eye(size(A)));

disp('Characteristic equation:');

disp(char_eq);

lambda_values = solve(char_eq, lambda);

disp('Verified eigenvalues:');

disp(lambda_values);
% Compute eigenvectors

[V, D] = eig(A);

disp('Eigenvectors:');

disp(V);

disp('Diagonal matrix of eigenvalues:');

disp(D);

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy