Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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!

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Application Development And Design

Authors: Michael V. Mannino

1st Edition

0072463678, 978-0072463675

More Books

Students also viewed these Databases questions

Question

Classify delivery styles by type.

Answered: 1 week ago