x=1:27;
y=[21,65,127,281,558,923,1321,1801,2420,3125,3886,4638,5306,6028,6916,7646,8353,9049,9503,10098,10540,10910,11287,11598,11865,12086,12251];
a=[337,-0.5,1];
f=@(a,x)a(1).*exp(exp(a(2)*x+a(3)));
[A,resnorm]=lsqcurvefit(f,a,x,y)
t=27;
while abs(A(1)exp(exp(A(2)(t+1)+A(3)))-A(1)*exp(exp(A(2)t+A(3))))>1
t=t+1;
end
A(1)exp(exp(A(2)(t+1)+A(3)))
t=1:500; plot(x,y,''); hold on;
plot(t,A(1).*exp(exp(A(2)*t+A(3))))