MATLAB: Is it possible to use lsqcurvefit without text messages


I dont want to see this in the command window:
Local minimum possible.
lsqcurvefit stopped because the final change in the sum of squares relative to its initial value is less than the default value of the function tolerance.
x =
498.8309 -0.1013
warning off is not a solution. So what to do?

Best Answer

  • The following should work:
    opt = optimoptions('lsqcurvefit','Display','off');
    x = lsqcurvefit(fun,x0,xdata,ydata,lb,ub,opt)