Plot the volume for a horizontal cylinder

13 views (last 30 days)
Deia Craig
Deia Craig on 26 Sep 2019
Commented: Luis Mendez on 5 Jun 2021
  3 Comments
Star Strider
Star Strider on 26 Sep 2019
Your code appears to do what the assignment requests.
What do you want help with?
Luis Mendez
Luis Mendez on 5 Jun 2021
how do you pdf your input and output with the Graph

Sign in to comment.

Answers (1)

Bruno Teramoto
Bruno Teramoto on 26 Sep 2019
L = 5;
r = 3;
h = [0:.2:r]';
V = ((r^2*acos((r-h)/r)) - (r-h).*sqrt(2*r*h - h.^2))*L;
plot(h,V)
title('Horizontal Cylinder Liquid Volume')
ylabel('Liquid Volume (in^3)')
xlabel('Liquid Depth (in)')

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!