using matlab with the input and the output please The volume V of liquid in a ho
ID: 2073492 • Letter: U
Question
using matlab with the input and the output please
The volume V of liquid in a hollow horizontal cylinder of radius r and length L is related to th depth of the liquid h by Develop an M-file to create a plot of volume versus depth. Here are the first few lines: function cylinder (r, L, plot_title) % volume of horizontal cylinder % inputs : % r = radius % L = length % plot-title-string holding plot title Test your program with >> cylinder(3,5,. 'Volume versus depth for horizontal... cylindrical tank')Explanation / Answer
clc
clear all
close all
r= input('inner radius of cylinder');
l= input('length of cylinder');
i=1;
h=0:0.1:2*r;
for i= 1:length(h)
V(i)= (r^2 * acos((r-h(i))/r) - (r-h(i))*sqrt(2*r*h(i) - h(i)^2))*l;
i=i+1;
end
plot(h,V);
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.