1. Convert the for loop in the following code into matrix operation (1 point). Use the profile tool to check the run tim

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
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

Post by answerhappygod »

1 Convert The For Loop In The Following Code Into Matrix Operation 1 Point Use The Profile Tool To Check The Run Tim 1
1 Convert The For Loop In The Following Code Into Matrix Operation 1 Point Use The Profile Tool To Check The Run Tim 1 (31.91 KiB) Viewed 28 times
Please be profesional and do not copy the answer from
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
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply