Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Code in Question: n = 5000; % generate a set of n orthogonal vectors to use as eigenvectors B = rand(n, n); [Q, ~] =
Code in Question:
n = 5000;
% generate a set of n orthogonal vectors to use as eigenvectors B = rand(n, n); [Q, ~] = qr(B);
% generate a set of n eigenvalues between 1
% generate the SPD dense matrix explicitly A = Q * D * Q';
You will find on Blackboard a starter file that generates a (random) symmetric positive definite matrix of size 5000 x 5000 and computes its Cholesky factorization via the Matlab chol() function. Complete the script to: generate a random right hand-side vector b perform forward and backward passes on the factors to obtain the solution of Az = b verify the correctness of your solution by computing the norm of the residual r = Az - b. The norm of r, || Ar - b||, is not exactly zero because of rounding errors made in floating point computations but should be a small number on the order of machine precision. You will find on Blackboard a starter file that generates a (random) symmetric positive definite matrix of size 5000 x 5000 and computes its Cholesky factorization via the Matlab chol() function. Complete the script to: generate a random right hand-side vector b perform forward and backward passes on the factors to obtain the solution of Az = b verify the correctness of your solution by computing the norm of the residual r = Az - b. The norm of r, || Ar - b||, is not exactly zero because of rounding errors made in floating point computations but should be a small number on the order of machine precisionStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started