n=3000; p=6; A=rand(n,n); B=rand(n,p) % PART 1: % FIND x for the p columns of B
ID: 2961617 • Letter: N
Question
n=3000;
p=6;
A=rand(n,n);
B=rand(n,p)
% PART 1:
% FIND x for the p columns of B such that Ax=b using LU decomposition,
% where b=B[1:end,i], for i=1,...,p.
% (5pt)
% hint: you can use the Matlab function [L,U,P] = lu(A).
% PART 2:
% Plot the p solutions in subplot such that the first quadrant holds the
% results for the first set of solution and the last quadrant hold the
% results for the last set of solutions.
% (5pt)
% hint use the Matlab function subplot or type "help subplot" in the
% command window to learn more ...
Explanation / Answer
n=3000;
p=6;
A=rand(n,n);
B=rand(n,p);
for i=1:p
b(i)=B(i)
end
[A,x]=lu(b)
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.