Matlab question
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
1. Convert the for loop in the following code into matrix operation (1 point). Use the profile tool to check the run tim
-
answerhappygod
- Site Admin
- Posts: 899604
- 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
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!