Code to get Spectra of Matrix