MATLAB: el código lsqnonlin de 2010b no funciona en 2008a

I've written a script in MATLAB 2010 in which I called the lqnonlin function and it worked fine.

options = optimset('TolFun',0.001,...
[X,R2,r] = lsqnonlin(@FCN,XO,[],[],options);

I then ran the code in MATLAB 2008a as follows (after reading MATLAB: ¿LSQNONLIN cambia en R2011a?)

options = optimset('TolFun',0.01,...
[X,R2,r] = lsqnonlin(@FCN,XO,[],[],options);

It's giving an output, but not giving the correct answer - in fact it remains unchanged from the original inputs

Thinking/hoping it's to do with my options settings


Had to tweak 'TolFun' to a far lower setting. no idea why.

preguntado el 08 de noviembre de 11 a las 09:11

maybe you should post your solution as answer, and mark the question as solved -

1 Respuestas

Was a 'TolFun' issue. Had to set it far lower (1e-9). Though I have no idea why this is. The rest of the code is identical.

respondido 09 nov., 11:01

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.