Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The following MATLAB commands generate the matrix B , the matrix A = B T B and two vectors b and z ( these commands

The following MATLAB commands generate the matrix B, the matrix A=BTB and two vectors b and z(these commands have already been entered for you)
n=70;
B=eye(n)-triu(ones(n),1);
A=B'**B;
Z=ones(n,1);
b=A**z
Similarly to the previous problem, the exact solution of the system Ax=b is the vector z Compute the solution using the al ?? and using the inverse:
x=Alb
y=inv(A)**b;
Compare the accuracy of the two methods as in the previous problem, that is, compute
??(?abs(x-z))
??(?abs(y-z))
Store the results in the variables err1 and err2 respectively.
Recall that the two commands above compute how close the computed solution is to the exact solution. Thus the naller value is associated to the more accurate method.
Don't worry about MATLAB warning messages. They are due to the fact that the matrix B is (numerically) close to singular.
Which method produces the more accurate solution? You will be asked to answer this question in the next exercise.
Don't forget to include your name as a comment in your script.
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Put Your Data To Work 52 Tips And Techniques For Effectively Managing Your Database

Authors: Wes Trochlil

1st Edition

0880343079, 978-0880343077

More Books

Students also viewed these Databases questions