function out=residfn(x) %This function takes in the guesses for the fitting parameters and returns %the sum of the square of the residuals. The data is passed in using the %global command: global datapass data=datapass; t=data(:,1); ca=data(:,2); resid=ca-1.0./(x(1)+x(2)*t); out=resid'*resid;