Quoted By:
function [ TotalCost ] = Cost( r )
%input an r value between 0 and (900/pi)^1/3
% this function calculates the cost based on the r value
h = (600 - (2 * pi * r^3 / 3)) / (pi * r^2);
SA_C = 2 * pi * r * h; %surface area of cylinder
SA_T = 2 * pi * r^2; %surface area of top
Cost_C = SA_C * 400; %cost of cylinder
Cost_T = SA_T * 600; %cost of top
TotalCost = Cost_C + Cost_T;
end
Trying to find the smallest value of TotalCost using the function
fminbnd(Cost, 0, 6.5922);
but it returns an error of "not enough input arguments." I thought 0 through 6.5922 were the input arguments?