我想在lsqcurvefit
命令中使用 Levenberg Marquardt 算法。我做了以下事情:
options = optimset('LevenbergMarquardt','on');
x = lsqcurvefit(@myfun,x0,xdata,ydata,options);
我收到以下错误:
??? Error using ==> optim\private\lsqncommon
LSQCURVEFIT only accepts inputs of data type double.
Error in ==> lsqcurvefit at 149
[x,Resnorm,FVAL,EXITFLAG,OUTPUT,LAMBDA,JACOB] = ...
我该如何克服这个错误?