Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Generate square (nn) matrices with random elements and n of 5, 50 100 150 200, 400. 600, 800, 1000. Measure how long it takes Matlab

image text in transcribed

Generate square (nn) matrices with random elements and n of 5, 50 100 150 200, 400. 600, 800, 1000. Measure how long it takes Matlab to calculate the inverse of each matrix by run- ning tic; inv(A); time.needed = toc;. Plot the time taken versus matrix size. Plot log time-needed versus log n. How does the calculation time change as n gets bigger? Do a simple linear regression of log(time) as a function of log(n) and report the slope of the regression line. What slope would you expect if the calculation time was proportional to the number of arithmetic operations required to find the matrix inverse? Generate square (nn) matrices with random elements and n of 5, 50 100 150 200, 400. 600, 800, 1000. Measure how long it takes Matlab to calculate the inverse of each matrix by run- ning tic; inv(A); time.needed = toc;. Plot the time taken versus matrix size. Plot log time-needed versus log n. How does the calculation time change as n gets bigger? Do a simple linear regression of log(time) as a function of log(n) and report the slope of the regression line. What slope would you expect if the calculation time was proportional to the number of arithmetic operations required to find the matrix inverse

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

Semantics In Databases Second International Workshop Dagstuhl Castle Germany January 2001 Revised Papers Lncs 2582

Authors: Leopoldo Bertossi ,Gyula O.H. Katona ,Klaus-Dieter Schewe ,Bernhard Thalheim

2003rd Edition

3540009574, 978-3540009573

More Books

Students also viewed these Databases questions