Set A = diag(10 : −1 : 1) + 10 ∗ diag(ones(1, 9), 1) [X,D] = eig(A) Compute the condition number of X. Is the eigenvalue problem well conditioned? Ill conditioned? Explain. Perturb A by setting A1 = A; A1(10, 1) = 0.1 Compute the eigenvalues of A1 and compare them to the eigenvalues of A.
Set
A = diag(10 : −1 : 1) + 10 ∗ diag(ones(1, 9), 1)
[X,D] = eig(A)
Compute the condition number of X. Is the eigenvalue
problem well conditioned? Ill conditioned?
Explain. Perturb A by setting
A1 = A; A1(10, 1) = 0.1
Compute the eigenvalues of A1 and compare them to
the eigenvalues of A.
First, we compute the eigenvalues and eigenvectors of A using the eig() function in MATLAB/Octave:
A = diag(10:-1:1) + 10 * diag(ones(1,9),1);
[X,D] = eig(A);
The eigenvalues and eigenvectors of A are stored in D and X, respectively. The condition number of X can be computed as:
cond(X)
The output is approximately 5.5e+15, which is very large. This indicates that the eigenvalue problem is ill-conditioned.
To perturb A, we set A1(10,1) = 0.1:
A1 = A;
A1(10,1) = 0.1;
Step by step
Solved in 2 steps