资源描述:
《lsqcurvefit __ 非线性拟合函数.pdf》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、lsqcurvefitSolve nonlinear curve-fitting (data-fitting) problems in least-squares senseEquationFind coefficients x that solve the problemgiven input data xdata, and the observed output ydata, where xdata and ydata arematrices or vectors of length m, a
2、nd F (x, xdata) is a matrix-valued or vector-valuedfunction.The lsqcurvefit function uses the same algorithm as lsqnonlin, and provides aninterface designed specifically for data-fitting problems.Syntaxx=lsqcurvefit(fun,x0,xdata,ydata)x=lsqcurvefit(fu
3、n,x0,xdata,ydata,lb,ub)x=lsqcurvefit(fun,x0,xdata,ydata,lb,ub,options)x=lsqcurvefit(problem)[x,resnorm]=lsqcurvefit(...)[x,resnorm,residual]=lsqcurvefit(...)[x,resnorm,residual,exitflag]=lsqcurvefit(...)[x,resnorm,residual,exitflag,output]=lsqcurvefit
4、(...)[x,resnorm,residual,exitflag,output,lambda]=lsqcurvefit(...)[x,resnorm,residual,exitflag,output,lambda,jacobian]=lsqcurvefit(...)Descriptionlsqcurvefit solves nonlinear data-fitting problems. lsqcurvefit requires a user-definedfunction to compute
5、 the vector-valued function F (x, xdata). The size of the vectorreturned by the user-defined function must be the same as the size of the vectors ydataand xdata.NotePassing Extra Parameters explains how to pass extra parameters tothe function F, if ne
6、cessary.x=lsqcurvefit(fun,x0,xdata,ydata) starts at x0 and finds coefficients x to best fit thenonlinear function fun(x,xdata) to the data ydata (in the least-squares sense). ydatamust be the same size as the vector (or matrix) F returned by fun.x=lsq
7、curvefit(fun,x0,xdata,ydata,lb,ub) defines a set of lower and upper bounds onthe design variables in x so that the solution is always in the range lb≤x≤ub.x=lsqcurvefit(fun,x0,xdata,ydata,lb,ub,options) minimizes with the optimizationoptions specified
8、 in the structure options. Use optimset to set these options. Passempty matrices for lb and ub if no bounds exist.x=lsqcurvefit(problem) finds the minimum for problem, where problem is a structuredescribed in Input Arguments.Create the structu