
% Define the data sets that you are trying to fit the
% function to
X = Pt_data1(:,1);
Y = Pt_data1(:,6);
% Initialize the coefficients of the function
params0=[0,1];
 
% Set an options file for LSQNONLIN to use the
% medium-scale algorithm
options = optimset('Largescale','off');
 
% Calculate the new coefficients using LSQNONLIN
[params,resnorm]=lsqnonlin(@yoursimp,params0,[],[],options,X,Y);
 
% Plot the original and experimental data
Z=params(2).*X+params(1);
plot(X,Y,'+r',X,Z,'b');