Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Can anybody help me to solve these three questions (Exercises1-3)in MATLAB device, I also posted some basic MATLAB information in last two photos! Thank you

Can anybody help me to solve these three questions (Exercises1-3)in MATLAB device, I also posted some basic MATLAB information in last two photos! Thank you very much! image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
EXERCISES Instructions: For the following three problems, follow the instructions in LAB1to create a diary text 1. (a) Set 1000 and generate an n x n matrix and two vectors in R", all having integer entries, by setting A floor (10 rand (n)) b sum (A') z ones (n,1) The exact solution of the system Ax b is the vector z. One could compute the solution in MATLAB using the "I" operation or by computing A 1 and then multiplying A times b. Let us compare these two computational methods for both speed and accuracy. The inverse of the matrix A can be computed in MATLAB by typing inv(A). One can use MATLAB tic and toc commands to measure the elapsed time for each computation. To do this, use the commands tic x Alb toc tic, y inv (A) b toc (Make sure the 'tic toc' are on the same line). Which method is faster? (ii) To compare the accuracy of the two methods, we can measure how close the computed solutions x and y are to the exact solution z. One way to do this is to compute the sum of the absolute values of the components of the difference of the two veetors, that is, ilzi and ily zl. To evaluate these sums in MATLAB we use the following commands: sum (abs (x z)) sum (abs (y z)) Since we are finding the difference between the oomputed solution and the exact solution, the smaller number is associated with the method that is more accurate. Recall that x was computed using the operation i while y was computed using the inverse. What method produces the most accurate solution? (b) Repeat part (a) using n 2000 and n 5000, (c) Explain why the exact solution of the system Ax bis the vector z. Hint: Try computing Az for a 2 x 2 or 3 x 3 matrix by hand. Then figure out what b sum is in terms of 3 the matrix A. Then compare Az to b

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

Records And Database Management

Authors: Jeffrey R Stewart Ed D, Judith S Greene, Judith A Hickey

4th Edition

0070614741, 9780070614741

More Books

Students also viewed these Databases questions