Unrecognized function or variable 'tankvolume'.
Show older comments
I keep receiving unrecognized function or variable 'tankvolume' when I call the function having R=0.9 and d=1 as arguments.
here is my code.
function Vol = tankvolume(R, d)
if d < R
Vol = pi * d ^ 3 / 3;
elseif d <= 3 * R
V1 = pi * R ^ 3 / 3;
V2 = pi * R ^ 2 * (d - R);
Vol = V1 + V2;
else
Vol = 'overtop';
end
1 Comment
Davide Masiello
on 4 Feb 2022
I have saved the function on my pc and run it, there's no problem.
There could be several reasons why you're getting that error.
Maybe the function is not saved in the "current folder", or you might have mispelled the function name when calling it.
Accepted Answer
More Answers (0)
Categories
Find more on Startup and Shutdown in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!