MATLAB, eigenvalues and condition number of a symmetric square matrix

Click For Summary
SUMMARY

This discussion focuses on calculating the condition number of a symmetric square matrix using MATLAB®. The power method is employed to compute the eigenvalues, and the built-in MATLAB® function "cond" is utilized for comparison. The script must include error handling for non-square or non-symmetric matrices. The output displays both the condition number from the power method and the built-in function.

PREREQUISITES
  • Understanding of MATLAB® programming
  • Knowledge of eigenvalues and eigenvectors
  • Familiarity with the power method for eigenvalue computation
  • Concept of matrix condition number
NEXT STEPS
  • Implement the power method for eigenvalue calculation in MATLAB®
  • Explore error handling techniques in MATLAB® functions
  • Research the significance of matrix condition numbers in numerical analysis
  • Learn about alternative methods for eigenvalue computation, such as QR algorithm
USEFUL FOR

Mathematicians, engineers, and data scientists who need to analyze the stability of numerical algorithms involving symmetric square matrices in MATLAB®.

osqen
Messages
6
Reaction score
0
2. Write a MATLAB® function to calculate the condition number of a symmetric square matrix of any size by means of Eigenvalues:

§ The power method should be used to calculate the Eigenvalues.

§ The script (function) should give an error message if the matrix is not square and/or is not symmetric.

§ The result of the built-in MATLAB® function “cond” should be displayed in addition to the results of the power method.

For example:



function [condPower,condMatlab]=NameofFunction(A,…)





condPower=…;

condMatlab=cond(A);

fprintf(‘Condition of matrix calculated using the Power method is %5.2g and using cond(A) is %5.2g \n’, condPower,condMatlab);
 
Physics news on Phys.org
osqen said:
2. Write a MATLAB® function to calculate the condition number of a symmetric square matrix of any size by means of Eigenvalues:

§ The power method should be used to calculate the Eigenvalues.

§ The script (function) should give an error message if the matrix is not square and/or is not symmetric.

§ The result of the built-in MATLAB® function “cond” should be displayed in addition to the results of the power method.

For example:



function [condPower,condMatlab]=NameofFunction(A,…)





condPower=…;

condMatlab=cond(A);

fprintf(‘Condition of matrix calculated using the Power method is %5.2g and using cond(A) is %5.2g \n’, condPower,condMatlab);

First, how do you find the condition number of a matrix if you know the eigenvalues?

Second, how do you compute the eigenvalues using the power method?

Which of these are you having trouble with?
 

Similar threads

  • · Replies 2 ·
Replies
2
Views
1K
  • · Replies 5 ·
Replies
5
Views
6K
  • · Replies 1 ·
Replies
1
Views
735
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 11 ·
Replies
11
Views
10K
  • · Replies 1 ·
Replies
1
Views
4K
  • · Replies 8 ·
Replies
8
Views
3K