How to stop message in command window

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.
-----------------------

 採用された回答

strunack
strunack 2012 年 12 月 6 日

0 投票

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

3 件のコメント

Yi Zhang
Yi Zhang 2013 年 1 月 4 日
nice! I also got annoyed by the same mesage.
Mr M.
Mr M. 2016 年 5 月 29 日
this is not working for me!
Walter Roberson
Walter Roberson 2016 年 5 月 29 日
Mr M., please show your code. Also, please indicate which MATLAB release you are using.

サインインしてコメントする。

その他の回答 (2 件)

strunack
strunack 2012 年 11 月 28 日

0 投票

Hello, any answer to my above question. I tried a lot to put parameter as display off, but not working.
tks

1 件のコメント

Jan
Jan 2012 年 11 月 28 日
Please post comments to your answer in the comment section, because this is not an answer.

サインインしてコメントする。

Jan
Jan 2012 年 11 月 28 日

0 投票

This message is an important warning that something might going wrong. I would never disable such warnings. Do you have a really good reason to suppress it?

4 件のコメント

strunack
strunack 2012 年 11 月 28 日
I have 2000000 nos of data sets and i use for loop and use lsqcurvefit inside it. I cannot check all the fitting parameters. So i put conditional statements where only selected data sets need to be chkd. Now since in all iterations the msg is displayed, I can't see my conditional parameters. Also displaying this msg eats up memory.
pls advice.
tks
Jan
Jan 2012 年 11 月 28 日
Why does displaying a message consume memory?
If you want to see a specific output, write it to a GUI or in a file.
strunack
strunack 2012 年 11 月 28 日
Dont you think displaying same convergence message 2000000 times is bit weired?? And why do you think displaying that msg wont consume memory?? I dont want to write it in a file. I want to see it online and when that condition is met 3 graphs will also appear.
Walter Roberson
Walter Roberson 2013 年 1 月 4 日
Displaying the message would use up memory only in the scrollable command window. You can adjust the amount of output that is saved for scroll-back. If you have it set to (say) 25000 lines, then when the 25001's line arrives for output, the old line 1 is deleted, the rest moved up (2 to 1, 3 to 2 and so on) and the new line would become the new 25000'th line. The amount of memory would thus be limited.
Taking up time is going to be more of a problem than taking up memory

サインインしてコメントする。

カテゴリ

質問済み:

2012 年 11 月 26 日

コメント済み:

2016 年 5 月 29 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by