% OBJECTIVE FUNCTION
f = @(x,b) b(1) - b(2)*x(:,1).* exp(-b(3)*x(:,2))

% PROBLEM SETUP
NIST_Nelson

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

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