MATLAB Answers

not enough input arguments Urgent Help

4 views (last 30 days)
Rey Perez
Rey Perez on 16 Sep 2021
Answered: Star Strider on 17 Sep 2021
function [V] = Tank_Volume(R, h, L, H)
% h is fluid height
% R is radius of tank
% H is tank height
% L is the lenght of the tank
if h<0
error('Please fill the tank!!') ;
elseif h>=0 && h<R
V= L*(R^2*acos((R-h)/R)-(R-h)*sqrt(h(2*R-h))) ;
elseif h>=R && h<=H
V=(L*((pi*R^2)/2+((h-R)*2*R)));
else
error('Do not waste alcohol, drink it instead!!') ;
end
Not enough input arguments.
Error in Tank_Volume (line 18)
elseif h>=R && h<=H
Error in Main_Code (line 16)
V(i)=Tank_Volume(h(i),R,H);

Answers (1)

Star Strider
Star Strider on 17 Sep 2021
The function declaration is:
function [V] = Tank_Volume(R, h, L, H)
and the function call is:
V(i)=Tank_Volume(h(i),R,H);
.

Community Treasure Hunt

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

Start Hunting!

Translated by