matlab13
matlab13
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).
Materials Required
MATLAB Software
Procedure
1. Define a Square Matrix: Create or input a square matrix AAA for which eigenvalues will be
computed.
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;
solve(char_eq, lambda);
[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
% Compute eigenvalues
eigenvalues = eig(A);
disp(eigenvalues);
syms lambda;
disp('Characteristic equation:');
disp(char_eq);
disp('Verified eigenvalues:');
disp(lambda_values);
% Compute eigenvectors
[V, D] = eig(A);
disp('Eigenvectors:');
disp(V);
disp(D);