Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Ainv=myinv(A) that will compute the inverse of an inputted nonsingular matrix A.

ID: 3076681 • Letter: A

Question

Ainv=myinv(A) that will compute the inverse of an inputted nonsingular matrix A. otherwise will output the error message " Matrix is numerically singula". Your algorithm should be based on the following fact. To find an inverse of a n X n nonsingular matrix A, it is sufficient to solve the following n linear equations: where the column vectors on the right aides of these equations are precisely die columns of the n times n identity matrix. It then would be clear that so that the desired inverse of A is the matrix Your algorithm should be based on the LU-decomposition. so it. gets, computed once, rather than doing a complete Gaussian elimination for each of the n equations. Feel free to use MATLAB's built in function "lu". see how to use LU-faetorization to solve linear systems. Apply it to solve a linear system for Hilbert matrix II4. Use function to solve system in part(b). which, is faster? Define a n times n matrix A with entries and Ax = b. For n = 100.200...., 500. use MATLAB's buil tin slash, operator to compute the solutions x using the double precision. Define Your code should print a table with columns n, c1, c-2 and cond(A). Also plot n versus el, n versus c'2 and n versus Cond(A).

Explanation / Answer

I am sure you are aware: multiple question posts is prohibited. Here is the answer to the second question. function U = domtxsim N = linspace(100, 500, 5)'; for Niter = 1:5 n = N(Niter); A = zeros(n,n); x = ones(n,1); for i=1:n for j=1:n A(i,j) = sqrt( (i-j)^2 + n/10); end end b = A*x; xbar = A; e1(Niter,1) = norm(x-xbar,inf); r(Niter,1) = norm(b - A*xbar,inf); e2(Niter,1) = e1(Niter)/(r(Niter)/norm(b,inf)); condA(Niter,1) = cond(A); end U = [N e1 e2 condA] figure(1) subplot(1,3,1) plot(N, e1) xlabel('n') ylabel('e_1') subplot(1,3,2) plot(N, e2) xlabel('n') ylabel('e_2') subplot(1,3,3) plot(N, condA) xlabel('n') ylabel('Cond(A)')

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote