Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Matlab in meters, where 't is the time in PROBLEM 1 Consider the equation 2400-(t-40)2 seconds. Write a script to do the following . Clear

Matlab
image text in transcribed
in meters, where 't is the time in PROBLEM 1 Consider the equation 2400-(t-40)2 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() which should go from O to 100 by 0.25 .Use t() to calculate the values y() 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 PROBLEM 2: 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 . Using a WHILE loop structure in t and again having a time step size of 0.01 Using a WHILE loop structure in 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. seconds, find the time t at which y is at a maximum. determine the elapsed time required for y to go from 1000 up to 2000 meters HINT: Solve this problem using the following logic. 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. PROBLEM 3: Using if-end and while-end statements, perform the following: 1) Prompt the user to enter numerical grades, one grade at a time (i.e. do not use vectors). Any number of grades can be entered, however, each grade must be non-negative and no larger than 100. Otherwise, the grade is considered invalid and the user should be prompted to re-enter the grade. A grade of 999 indicate the user has finished entering numerical grades. 2) Compute the number of grades in each grade range using the standard grading policy: A [90- 100], B [80-90), C 170-80), D [60-70), F [0-60) Compute the minimum grade, maximum grade, and average grade. You are N allowed to use built-in functions min), max(), sum(), or mean

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 Reliability Engineering Designing And Operating Resilient Database Systems

Authors: Laine Campbell, Charity Majors

1st Edition

978-1491925942

More Books

Students also viewed these Databases questions