Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

2.1 (40 pts) Cylindrical storage tanks often have conical bottoms to facilitate drainage. One particular tank design specifies a radius of R, a total height

image text in transcribed

2.1 (40 pts) Cylindrical storage tanks often have conical bottoms to facilitate drainage. One particular tank design specifies a radius of R, a total height of 3R, and the height of the conical bottom to be R. Write an m-file function tank_volume.m that calculates the volume of liquid in such a tank if the liquid level is d Function: tank volume.m Inputs R: an array of R values representing the radius of the tank. The overall height of the tank 1S 3R d: an array of liquid height values measured from the bottom of the tank Outputs V: an array of tank volumes, of the same shape as the input data R and d Your function should have two checks Issue an error statement if the arrays R and d are not the same shape Issue an error if, for any value of d, d> 3R (tank overflow!). Hint: typing "doc any" at the command line will show a simple suggestion for testing all values in the array simultaneously Driver: hw2 1m Create a simple script that uses your tank_volume function to generate a plot (on a single axis) of the liquid volume vs. liquid level for R 1 m and R = 2 m. Your plot should be p (axes, title, legend). No output from the function file or the driver file should be displayed other than the plot when the driver file is executed properly labeled Hint: The volume of a cone is-; the tank radius is R

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_2

Step: 3

blur-text-image_3

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

International Baccalaureate Computer Science HL And SL Option A Databases Part I Basic Concepts

Authors: H Sarah Shakibi PhD

1st Edition

1542457084, 978-1542457088

More Books

Students also viewed these Databases questions

Question

When is it appropriate to use a root cause analysis

Answered: 1 week ago