% OBJECTIVE FUNCTION
f = @(x,b) b(1)*exp(-b(2)*x)+b(3)*exp(-b(4)*x)+b(5)*exp(-b(6)*x)

% PROBLEM SETUP
NIST_Lanczos2

% GRAPHIC REPRESENTATION
scatter(x,y)

% OPTIMIZATION 
rng(0)	% for tractability 
[b,info] = lsqcurvefit(f,ig1,x,y)	% running minimization 

% ANIMATION
% Uncomment the following code to generate animation % 
% rng(0)
% [~,info] = lsqcurvefit(f,ig1,x,y)
% info.plot = 'fit'
% info.animate = true	% plot animation 
% info.animfreq = 6	% frame frequency 
% optimview('lsqcurvefit',info) 