[Scilab-users] lsqrsolve

Stéphane Mottelet stephane.mottelet at utc.fr
Fri Apr 24 08:29:11 CEST 2015


Le 24/04/2015 01:56, fujimoto2005 a écrit :
> function ret=err_test(param,argVector1,argVector2)
>      err(1)=param(1)^2;
>      err(2)=param(2)^2;
>      err(3)=param(3)^2;
>      err(4)=param(1)*param(2);
>      ret=err;
> endfunction
>
> para=[1,2,3];
> argVector1=zeros(1,5);
> argVector2=zeros(1,3)
> lsqrsolve(para,list(err_test,argVector1,argVector2),4)
Hello,

you are missing the size parameter (here I called it "n") in the 
residual function :

function ret=err_test(param,n,argVector1,argVector2)
     err(1)=param(1)^2;
     err(2)=param(2)^2;
     err(3)=param(3)^2;
     err(4)=param(1)*param(2);
     ret=err;
endfunction


S.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20150424/19ea636a/attachment.htm>


More information about the users mailing list