Computers and Technology, 07.04.2020 20:20, Skylar4483
P1. Write a MATLAB function with inputs • m and n, two positive integers, • a matrix A of size m × n, • a vector x of size n × 1, and which outputs the product vector A × x (note that the size of this vector should be m × 1). Your code should check that the sizes of the inputs are right and then do the multiplication using two nested "for" loops. a) How many floating point operations (additions and multiplications) does the code use? Find a formula in terms of m and n. b) Run the code with n = 100, m = 100, and inputs A =rand(m, n) and x =rand(n, 1). Modify the function by introducing a new output variable, op count, which initializes to 0 outside of the nested for loops (just like we did with product in class) and is incremented inside the innermost of the for loops by the number of operations done to update product. (We will do an example of this on Wednesday.) Output op count as well as product. Repeat the experiment for m = 200, n = 100; m = 100, n = 200; and m = n = 200. Do the ratios of the new op count outputs to the old one you got for m = n = 100 confirm the floating point operation formula you found in part a)?
Answers: 1
Computers and Technology, 23.06.2019 06:30, arguellesjavier15
Who can provide you with a new password when you have forgotten your old one? your provide you with a new password in case you forget your old one.
Answers: 3
Computers and Technology, 23.06.2019 09:00, Riddledjam44623
Before you record your own voice, you should a. record other people's voices b. warm up and practice difficult names c. listen to your favorite songs d. read a transcript of a good radio news segment
Answers: 1
P1. Write a MATLAB function with inputs • m and n, two positive integers, • a matrix A of size m × n...
Mathematics, 21.09.2021 08:50
Physics, 21.09.2021 08:50
Mathematics, 21.09.2021 08:50
Mathematics, 21.09.2021 08:50
Mathematics, 21.09.2021 08:50
English, 21.09.2021 08:50