Please use Matlab • Algorithm needs to work for any N by N square matrix, use the variable N. • For computations needing
Posted: Thu May 12, 2022 12:12 pm
Please use Matlab • Algorithm needs to work for any N by N square matrix, use the variable N. • For computations needing numerical tolerance use the variable tolerance = sqrt(eps) or tolerance = np.finfo(float).eps • Use format long command to display all available digits 1. Generate Random Matrices with Specified Eigenvalues (a) (5 pts) Generate a random symmetric trix, with eigenvalues {1,2, ...,N}. Use the similarity relation Α = QΛQ* = х N}. 1 where Q is a random unitary (N < N) matrix, and A a diagonal matrix with the eigenvalues on the diagonal. VERIFY, using a library call (Matlab / Python / R / ???) that your matrices indeed have the desired eigenvalues. SUBMIT: Code, and verification (output) for N= 20. (b) (5 pts) Generate a random non-symmetric matrix, with eigenvalues {1,2,. Use the similarity relation A=QTQ* where Q is a random unitary (N XN) matrix, and T a triangular matrix with the eigenvalues on the diagonal, and non-zeros in the upper triangular part. VER- IFY, using a library call (Matlab / Python / R / ???) that your matrices indeed have the desired eigenvalues. SUBMIT: Code, and verification (output) for N= 20. = Х