Question: Implement two MATLAB functions to perform ABx in two ways: (AB)x and A(Bx), where A,B Rnxn. You must write your own functions of matrix-matrix or

Implement two MATLAB functions to perform ABx in two ways: (AB)x and

A(Bx), where A,B Rnxn. You must write your own functions of matrix-matrix or matrix-

vector multiplications using for loops and scalar operations; do NOT use built-in function

for matrix-matrix or matrix-vector multiplications. Measure the runtimes for each n, and plot

the runtimes of two functions against n for n = 50 x [1, 2, 4, 8, 16]. Submit your completed code, and

also submit a report with the plots of the runtimes and an analysis of the numbers of foating-point

operations for each approach. Does your analysis correlate well with their actual performances?

Note: In MATLAB, you can use built-functions tic and toc to time the code; make sure you run

multiple times and then average the runtime. You can submit the code

and the report as two separate files, or submit a single MATLAB Live Script and report combined.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Mathematics Questions!