function yout = exp_model(x,p)
% Defines model for exponential decay such that the decay rate is treated as a nonlinear fitting parameter, and the prefactor of this term, as well as an allowed off-shift from zero, are fitted linearly. You shouldn't need to change anything here.
global smallit

A = zeros(length(x),2);
A(:,1) = exp(-p*x);
A(:,2) = ones(length(x),1);
    
C = A\smallit;
yout = A*C;
