 % script leasq example
% generate some data

%Arthur Jutan 
%Dept of Chemical and Biochemical Enginering
%Univ of Western Ontario
%London Ontario Canada, N6A 5B9

t=[0.:.01:1]';
p=[4 5];
y=exp(-p(1)*t).*sin(2*pi*p(2)*t);
% rand('normal');
y=y+.01*randn(size(y));  %add noise
%w=1;  % weights for y				  default=1.0
w=ones(size(y))*1.0;
% default tol=.0001;	%converg tolerance
% default iter=200* length(p)	% max iterations (func evals)
pin=[2	3];	  %initial guess
%[f,p,var,iter,cor,std]=leasqr1(t,y,pin,'model'{,tol,iter,wt});
[f,p,var,iter,cor,std]=leasqr1(t,y,pin,'model',[],[],w);
