ind a nonsingular matrix p such that p-1ap is a diagonal matrix, use sym(a) to get elements of p. in matlab
main.m
A = [a11, a12, a13; a21, a22, a23; a31, a32, a33]; % Define matrix A[P,D] = eig(sym(A)); % Find eigenvectors and eigenvalues of AP_inv = inv(P); % Calculate the inverse of matrix PD % The diagonal matrixP_inv * A * P % The diagonal matrix P^(-1) * A * P