Question: Can I please get some help with program 2? The equation for program 1 is the same equation used for program 2. Consider the equation

Can I please get some help with program 2? The equation for program 1 is the same equation used for program 2.

Can I please get some help with program 2? The equation for

Consider the equation y = 2400 - (t - 40)^2 in meters, where 't' is the time in seconds. Write a script to do the following: Clear the screen and the variables Determine the number of loops required to generate values of t from 0 to 100 seconds with a step size of 0.25 seconds. Reserve memory for the variables t and y. Use a FOR loop to set up the index variable i. Use i to calculate and store t (i) which should go from 0 to 100 by 0.25's. Use t (i) to calculate the values y (i) in the loop. Create a plot in a Figure 1 with time t as the variable on the x axis and the y variable on the y axis. Add the title "Y versus Time", the x axis label "Time (sec)" and y axis label "Y (meters)" to the plot. Include a pause statement followed by a line of code to close the figure. Using a WHILE loop structure in the variable t with a time step size of 0.01 seconds, find the time t at which y passes through 1600 meters on the way up. Using a WHILE loop structure in the variable t with a time step size of 0.01 seconds, find the time t at which y passes through 1600 meters on the way down. Using a WHILE loop structure in t and again having a time step size of 0.01 seconds, find the time t at which y is at a maximum. Using a WHILE loop structure in t with a time step size of 0.01 seconds, determine the elapsed time required for y to go from 1000 up to 2000 meters. 1) Add a variable etime and set it equal to zero before the WHILE loop. 2) Allow the WHILE loop to run until say just past 2300 meters (which is > 2000m). 3) Inside the WHILE loop use an IF statement to determine if the value of y falls between the values of 1000 and 2000 meters. If it does, add 0.01 seconds to the running total variable for the elapsed time etime to count how much time is spent between 1000 and 2000 meters. 4) Use the FPRINTF command to show the result of etime

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!