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.
_______________________________________________
users mailing list
[email protected]
http://lists.scilab.org/mailman/listinfo/users

Reply via email to