Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

4) In Matlab, generate a square matrix [A] of random numbers having n rows, for n = 100, 200, 500, 1000, 2000, 5000 and 10,000.

image text in transcribed

4) In Matlab, generate a square matrix [A] of random numbers having n rows, for n = 100, 200, 500, 1000, 2000, 5000 and 10,000. (Don't display these!). Also generate a random column matrix (i.e., n by 1) {b} of random numbers. (Don't display!) Solve the corresponding system of equations([A]{x)=(b)) for {x). (Don't display the results!) Use the tic and toc functions in Matlab to record the computation time for solving the system in each case. For each n perform the calculation 10 times to obtain the average computation time. Plot the average time as a function of n, using a log-log plot. Comment on the overall trend. HINT: n= 1000; A = rand(n): b = rand(n, 1); to-tic; x = Alb; tval = toc(to)

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

The Structure Of The Relational Database Model

Authors: Jan Paredaens ,Paul De Bra ,Marc Gyssens ,Dirk Van Gucht

1st Edition

3642699588, 978-3642699580

More Books

Students also viewed these Databases questions

Question

14. What should the minutes of a meeting include?

Answered: 1 week ago