Matlab Question I don\'t understand what does the sentence \" solve Ax = b for t
ID: 3780330 • Letter: M
Question
Matlab Question
I don't understand what does the sentence " solve Ax = b for three different vectors b generated by rand" mean
I wrote:
A = rand(4);
b = rand(4,1);
[L,U,P] = lu(A);
x = A
is that right?
Thanks
blem 1. Use the rand command to generate a 4 x 4 matrix called A Use lu to decompose A into L, U, and P. Use this decomposition to solve Ar b for three different vectors b generated by rand. To get credit for this problem, you must use the L decomposition and not a direct solution or matrix inversion.Explanation / Answer
A = rand(4);
b = rand(4,1);
[L,U,P] = lu(A);
x = A
% x = A/b would solve the equation Ax = b.
% sample output
%x =
%-0.63046 %1.01124 % -1.06689 % 1.50575