How can I specify the maximum number of iterations or the tolerances used within the NLINFIT function within the Statistics Toolbox?

7 views (last 30 days)
Is it possible to change the maximum number of iterations ('Maxiter') argument or the tolerances ('Betatol' and 'Rtol') arguments of the function NLINFIT in the Statistics Toolbox 4.0 (R13)?
How can I specify the maximum number of iterations or the tolerances used within the NLINFIT function within the Statistics Toolbox 4.0 (R13)?
These properties are specified within the "maxiter", the "betatol", and the "rtol" variables within within the NLINFIT function.

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 27 Jun 2009
This enhancement has been made for the Statistics Toolbox 5.0 (R14). For previous product releases, please read below for any possible workarounds:
To work around this issue, try creating your own function , called NLINFIT2, based on the code of NLINFIT. Do do so, save NLINFIT as NLINFIT2, and change the 'Maxiter', 'BetaTol' or 'Rtol' arguments. For example, on lines 64 to 67, you can change from:
maxiter = 100;
iter = 0;
betatol = 1.0E-4;
rtol = 1.0E-4;
to
maxiter = 500; % Your value
iter = 0;
betatol = 1.0E-6;
rtol = 1.0E-6;
Note that this is not officially supported by MathWorks, Inc.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!