i need octive code or matlab code Diagonalize the matrix A
i need octive code or matlab code
Diagonalize the matrix A = (6 4 -3 -1) by computing S = P^-1 AP where P = (1 1 3 4). Also compute the eigenvalues of A and compute these with the diagonal elements of S.Solution
>> A=[6 -3;4 -1]
A =
6 -3
4 -1
>> P=[1 3;1 4]
P =
1 3
1 4
>> S=inv(P)*A*P
S =
3 0
0 2
>> E=eig(A)
E =
3
2
>> D=diag(S)
D =
3
2
>> %Both are same
