MATLAB: How to stop message in command window

lsqcurvefitstop displaystop message

Hi
When I use lsqcurvefit function I get the following msg in command window. Since in my program no. of iteration is so high that, I believe it eats up huge chunk of memory. Can i stop this msg to display??
————————-
>>[x,resnorm] = lsqcurvefit(@myfun,x0,xdata,ydata);
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.
———————–

Best Answer

  • Hi, finally I could able to find a solution myself.
    I used optimset to set the value of display to OFF then passed the options to lsqcurvefit. Did the job. It switch off the repeitative display and in the command window I used it to display more important msg like percentage of completion, points where function deviate from my set limit etc.
    options = optimset('Display','off');
    [x,resnorm] = lsqcurvefit(@myfun,x0,xdata,ydata,[],[],options);
    thank you for showing interest in my question