compute the inverse of the following matrix (1 -3 5 10 4 7
Answers
Answer:
Yes see below
Step-by-step explanation:
close all;
clear all;
clc;
format short;
rng(0,'twister');
size = 5000;
temp = rand(size);
A = temp*temp'; % A is positive definite
tic
B = inv(A);
fprintf('Time for inv(A) = %.3f seconds.\n',toc);
err1 = max(max(abs(A*B - eye(size))));
err2 = max(max(abs(B*A - eye(size))));
err = (err1+err2)/2.0;
fprintf('Error for inv(A) = %e\n',err);
tic
B = A\eye(size);
fprintf('Time for A\\eye = %.3f seconds.\n',toc);
err1 = max(max(abs(A*B - eye(size))));
err2 = max(max(abs(B*A - eye(size))));
err = (err1+err2)/2.0;
fprintf('Error for A\\eye = %e\n',err);
tic
L = chol(A,'lower');
U = L\eye(size);
B = L'\U;
fprintf('Time for chol(A) = %.3f seconds.\n',toc);
err1 = max(max(abs(A*B - eye(size))));
err2 = max(max(abs(B*A - eye(size))));
err = (err1+err2)/2.0;
fprintf('Error for chol(A) = %e\n',err)
Peace out.!
Mark as brainliest.!