Question: Using MATLAB, write scripts to calculate how long it takes to do each of the following ten million (i.e., 10^7) times. You may do the

Using MATLAB, write scripts to calculate how long it takes to do each of the following ten million (i.e., 10^7) times. You may do the test a few times in a row and choose the lowest value, so that you can eliminate any issues with your programming environment having to load other libraries, etc.

NOTE: Use the timing features of MATLAB (e.g., 'tic' and 'toc' in MATLAB). It is not acceptable to stopwatch this manually!

Please help and thank you!

Using MATLAB, write scripts to calculate how long it takes to doeach of the following ten million (i.e., 10^7) times. You may dothe test a few times in a row and choose the lowestvalue, so that you can eliminate any issues with your programming environment

How long (in seconds) does it take your code to set two variables to random numbers between one (1) and two (2)? It must generate a new random number for each variable each time. How long (in seconds) does it take your code to set two variables to random numbers between one (1) and two (2) and to multiply them together (storing into a third variable name)? It must generate a new random number for each variable each time. How long (in seconds) does it take your code to set two variables to random numbers between one (1) and two (2) and to divide the first by the second (storing into a third variable name)? It must generate a new random number for each variable each time. How long (in seconds) does it take your code to set two variables to random numbers between one (1) and two (2) and to take the sine of one of them (storing into a third variable name)? We won't do anything with the second random number this time around (it's just for consistency in the timing comparison). Your code must generate a new random number for each variable each time

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!