Finding the eigenvalues with an augmented matrix 2x2
9 次查看（过去 30 天）
Hi, I somehow have a problem with obtaining the row reduction in an augumented matrix to find lamda. Currently I have this code:
I = eye(2)
m1 = [7 3; 3 -1]
Lamda = 8 % The value for λ
LaI = I * Lamda % Identity matrix - value of λ
m2s = m1 - LaI % Caluculating the new matrix
zc = zeros(size(m2s,1),1) % creating a zero column
m3s = [m2s, zc] % adding the zero column at the end
A3 = [-1 3;
b = [0; 0]
[L, U, P] = lu(A3) % L = all multipliers, U = upper triangular matrix, P = row interchanges
% factors to solve linear system
y = L\(P*b) % Forward substitution
x = U\y %Backward substitution
In part D there I get this warning:
Warning: Matrix is close to singular or badly scaled. Results may be inaccurate. RCOND = 5.551115e-17. <warning </warning>
I got 2 question:
First, how do I fix it?
Second how can I define the relationship between x1 and x2?
Help is much appreciated <3 Thanks!
I understand you are trying to find the 'x' from system of equations A3x = b. The A3 that you specified is an singular matrix. So the inverse for the Matrix A3 does not exist. To solve this you can use 'pinv' function in MATLAB to find pseudo inverse.
'pinv' calculates 'Moore-Penrose pseudo inverse' matrix which can act as a partial replacement for the matrix inverse in cases where it does not exist. This matrix is frequently used to solve a system of linear equations when the system does not have a unique solution or has many solutions.
A3 = [-1 3;
b = [0; 0];
x = pinv(A3) * b
You can also use 'lsqminnorm' function to do the following task. lsqminnorm(A,B) returns an array X that solves the linear equation AX = B and minimizes the value of norm(A*X-B). If several solutions exist to this problem, then lsqminnorm returns the solution that minimizes norm(X)
For more details regarding the 'pinv' and 'lsqminnorm' functions please refer the following MATLAB documentation
Hope this helps.
Dinesh Reddy Gatla.