Question: ENGR 1204 Programming Languages in Engineering MATLAB Lab 1 Note: For all labs and assignments copy and paste into a Word file your program (script

 ENGR 1204 Programming Languages in Engineering MATLAB Lab 1 Note: For

ENGR 1204 Programming Languages in Engineering MATLAB Lab 1 Note: For all labs and assignments copy and paste into a Word file your program (script file), the relevant command window and plots if applicable. Try to condense the print-out as best as possible. Write a MATLAB program (.M script file) to calculate the time to drain a cylindrical water tank for an initial water height ranging from 1 to 10 feet. The tank has a radius (tt) of 2 feet and the drain radius (ro) is 0.3 inch. The gravitational constant is 32.2 feet/sec. 2 The formula for time to drain the tank is time = (rt/ro)2 h/vavg where vavg=0.5 (2 g h) (average velocity) In your program, assign the values shown to rt, ro, and g. Convert ro to feet using a separate statement. Use input to prompt the user to enter the value of h when the program runs. The program should calculate but not display vavg, and then calculate and display time in hours. Use formatted print (fprintf) to display the time with two significant fractional digits. A sample print-out is shown below: Run the program repeatedly for initial water heights of 1, 2, 3, ..., 10 feet. Sample print-out (for first value of h): Initial height of water (ft.) = 1 The time to drain the tank is 0.44 hours

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!