Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Exercise 1.1.14 please. Thank you. Exercise 1.1.14 Modify the MATLAB code from Exercise 1.1.9 by changing the matrix-vector multiply b = A*x to a matrix-matrix

Exercise 1.1.14 please. Thank you. image text in transcribed
image text in transcribed
Exercise 1.1.14 Modify the MATLAB code from Exercise 1.1.9 by changing the matrix-vector multiply b = A*x to a matrix-matrix multiply B-A"X, where Xisnxn. You may also want to decrease the initial matrix dimension n and the number of times rep loop is executed. Run the code and check the ratios. Are they close to what you would expect therm to be. based on the flop count? Exercise 1.1.9 Consider the following simple MATLAB program. n 500 for jay = 1:4 if jay > 1 oldtime = time ; end A randn (n) ; x = randn (n, 1) ; t cputime; for rep-1:100 % compute the product 100 times end matrixsize = n time = cputime - t if jay > 1 ratio- time/oldtime end n-2-n; end The syntax is simple enough that you can readily figure out what the program does The commands randn and b = A*x are familiar fromthe previous exercise, we perform each matrix-vector multiplication 100 times in order to build up a significant amount of computing time. The function cputime tells how much computer (central processing unit) time the current MATLAB session has used. This program times the execution of 100 matrix-vector multiplications for square matrices A of dimension 500, 1000, 2000, and 4000

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

Finance The Role Of Data Analytics In Manda Due Diligence

Authors: Ps Publishing

1st Edition

B0CR6SKTQG, 979-8873324675

More Books

Students also viewed these Databases questions