1. Engineering
  2. Computer Science
  3. programming 1 using basic programming for loops while loops and...

Question: programming 1 using basic programming for loops while loops and...

Question details

Programming: 1. Using basic programming (for loops, while loops, and if statements), write two functions in Matlab, both taking as input: dimension n; -n × n matrix A: -n × n matrix B; -nx1 vector Have the first function compute ABz through (AB)r and the second compute ABr through A(B). Have both output: the number of flops used. (a) Print out or write out the first function (b) Print out or write out the second function (c)Apply both your functions to the case with random matrices and vectors for n = 100 and printout or write out the results. Do the same for 200 x 200, 00 x 400, and 800 x 800. Which approach of computing ABr is faster?
Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution