Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The code is not working. Thank you! Fill out the order of the flow chart. CODE: function Vol = Chapra_Problem_3p1( d, R ) %% Input

The code is not working. Thank you!image text in transcribed

image text in transcribedFill out the order of the flow chart.

CODE:

function Vol = Chapra_Problem_3p1( d, R )

%% Input

% d: depths of liquid filling tanks, independent variable (1 x N)

% R: Radii of cylindrical tanks, parameter (1 x N)

%

%% Output

% Vol: Volumes computed for liquid filling tanks (1 x N)

% Set Vol(-) to -1 for 'Overtop'.

% Write your function here.

if d

Vol = (pi*d^3)/3;

else if d

V1 = (pi * R.^3)/3;

V2 = pi * R^2*(d-R);

Vol = V1+V2;

else

Vol = 'overtop';

end

end

end

3.1 Figure P3.1 shows a cylindrical tank with a conical base. If the liquid level is quite low, in the conical part, the volume is simply the conical volume of liquid. If the liquid level is midrange in the cylindrical part, the total volume of liquid includes the filled conical part and the partially filled cylindrical part 2R FIGURE P3.1 Use decisional structures to write an M-file to compute the tank's volume as a function of given values of R and d. Design the function so that it returns the volume for all cases where the depth is less than 3R.Return an error message C"Overtop") if you overtop the tank-that is, d> 3R. Test it with the following data: 0.9 1.5 1.3 1.3 1.25 3.8 4.0 Note that the tank's 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

Demystifying Databases A Hands On Guide For Database Management

Authors: Shiva Sukula

1st Edition

8170005345, 978-8170005346

More Books

Students also viewed these Databases questions

Question

=+ What skills and competencies will enable someone

Answered: 1 week ago

Question

=+to live and work wherever he or she wants?

Answered: 1 week ago

Question

=+How will this affect the recruiting process?

Answered: 1 week ago