1. Convert the for loop in the following code into matrix operation (1 point). Use the profile tool to check the run tim
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am
1. Convert the for loop in the following code into matrix operation (1 point). Use the profile tool to check the run tim
other websites
1. Convert the for loop in the following code into matrix operation (1 point). Use the profile tool to check the run time of each line in the code (2 points). Submit the screenshot (of the profile report with the run time of each line) here. % Code vectorization Y = randn (1000000, 1); X = randn (1000000, 1); Z = zeros (1000000, 1); for i = 1:1000000 z (i) = (x(i) *y (i) +y (i) +x (i))/x (i); end