No BSD License  

Highlights from
Nlsqbnd

from Nlsqbnd by Alain Barraud
Non linear Leasr Squares Solver with box constraints/

[F,Jac]=LSwatson(x)
function [F,Jac]=LSwatson(x)
n=length(x); 
F=zeros(31,1);Jac=zeros(31,n);I=(1:n-1);J=I-1;K=[0,I];
F(1)=x(1);F(2)=x(2)-x(1)^2-1;
Jac(1,1)=1;
Jac(2,1:2)=[-2*x(1),1];
for i=2:30
    r=(i-1)/29;
    v=0;for j=2:n,v=v+(j-1)*x(j)*r^(j-2);end
    w=0;for j=1:n,w=w+x(j)*r^(j-1);end
    F(i+1)=v-w*w-1;
    Jac(i+1,:)=[0,I.*r.^J]-2*w*r.^K;
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Contact us at files@mathworks.com