opti_lsqcurvefit
Solve a NLS using an OPTI solver (e.g. LM_DER)
Syntax
x = opti_lsqcurvefit(fun,x0,xdata,ydata)
x = opti_lsqcurvefit(fun,x0,xdata,ydata,lb,ub)
[x,fval,exitflag,info,Opt] = opti_lsqcurvefit(fun,x0,xdata,ydata,lb,ub,opts)
Description
x = opti_lsqcurvefit(fun,x0,xdata,ydata) solves the nonlinear least squares problem with fitting function specified by fun, initial guess x0, subject to the fitting data, xdata, ydata.
x = opti_lsqcurvefit(fun,x0,xdata,ydata,lb,ub) solves the constrained nonlinear least squares problem with bounds specified by lb, ub. This will automatically use a constrained NLS solver such as NL2SOL or MKLTRNLS.
[x,fval,exitflag,info,Opt] = opti_lsqcurvefit(fun,x0,xdata,ydata,lb,ub,opts) allows the user to specify additional options via opts, created from optiset. This includes being able to specify the solver used via the 'solver' field. Also returned is the function value at the solution, exitflag, plus information structure and internally created OPTI object.
Typical Use
This function is provided for users who are familiar with the Matlab Optimization Toolbox and its routines, and wish to experiment with OPTI toolbox routines without major code changes. It is suggested once you are familiar with the OPTI class and creating it, to use it explicitly rather than calling this function.
Copyright © 2011-2013 Jonathan Currie (I2C2)