function resid = myCurveFcn(x,t,y)

% x is the vector of coefficiencts
% t is the time vector
% y is the obesrvations at given t
% resid is the residual (or error)

yhat = x(1) + x(2)*exp(-t);
resid = yhat -y;