Función de prueba

function [h,L]=catenaria(a,T0, P, hmin)
a=400;
T0=2205;
P=0.975;
hmin=6;
gamma=P/(2*T0);
h=(T0/P)*(cosh(a*gamma)-1);
L=(T0/P)*(sinh(gamma*a));
f=@(x) (T0/P)*(cosh(gamma*(2*x-a))-cosh(gamma*a))+h+hmin;
fplot(f,[0,a],'r')
ylim([0 f(0)+hmin])
xlim([0 a])
grid on
end
ans =

    8.8493