Please how code, table (Made in MATLAB), and explain all steps. Thanks. Use the
ID: 2967525 • Letter: P
Question
Please how code, table (Made in MATLAB), and explain all steps. Thanks.
Use the matrix A = gallery('poisson' , 10) (in Matlab). You may want to use the result of the standard LU-factorization, [L, U, P, Q] = in(A) for reference. (a) Using [ell, you, pea] = luinc(A, 10-k) for k E {0, ?1,-2,-3}, make a table of the number of nonzeros in ell and the normal of ell*you - pea*A. (You have to convert a sparse matrix to full form before you can find its norm.) Use subplot to make a 2 x 2 tableau of spy plots for ell. Form a hypothesis about what luinc(A, 0) should do and check it. (b) Use tell, you, pea] = luinc (A , '0') to find an alternative type of of LU-factorization. Based on a spy plot of all, form a hypothesis about how this function works, explaining in particular how it is different from 'nine (A, 0).Explanation / Answer
A=gallery('poisson',10);
[L U P Q]=lu(A);
k=-3:0;
table=zeros(length(k),3);
table(:,1)=k';
for i=1:length(k)
[ell you pea]=luinc(A,10^k(i));
table(i,2)=nnz(ell);
table(i,3)=norm(full(ell*you-pea*A));
subplot(2,2,i)
spy(ell)
str=['spy plot for k=',num2str(k(i))];
title(str)
end
fprintf(' n non zero in ell norm ')
disp(table)
part 2:
A=gallery('poisson',10);
[ell you pea]=luinc(A,'0');
spy(ell)