matlab 最小二乘函数lsqcurvefit拟合函数参数的时候出现错误
matlab 最小二乘函数lsqcurvefit拟合函数参数的时候出现错误
我用lsqcurvefit 函数拟合参数的时候出现下面的错误,
Error using ==> optimprivatelsqncommon
User supplied function ==> imgfun
failed with the following error:
Subscript indices must either be real positive integers or logicals.
Error in ==> lsqcurvefit at 165
[x,Resnorm,FVAL,EXITFLAG,OUTPUT,LAMBDA,JACOB] = ...
Error in ==> imgmodel at 14
x=lsqcurvefit(@imgfun,x0,xdata,ydata);