MATLAB: Matlab give me error

argument

function hdot = height(t,h)
hdot = -(0.0334*sqrt(h))/(10*h-h^2);
[t, h] = ode45 (@height, [0 2475], 9);
plot(t,h),xlabel('Time (sec)'),ylabel('Height (ft)')
end

Best Answer

You need to move the ode45 and plot statements out of the function. Run it like this
[t, h] = ode45 (@height, [0 2475], 9);
plot(t,h)
xlabel('Time (sec)')
ylabel('Height (ft)')
function hdot = height(t,h)
hdot = -(0.0334*sqrt(h))/(10*h-h^2);
end