<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/152616</link>
    <title>MATLAB Central Newsreader - clear display</title>
    <description>Feed for thread: clear display</description>
    <language>en-us</language>
    <copyright>&amp;copy;1994-2012 by MathWorks, Inc.</copyright>
    <webmaster>webmaster@mathworks.com</webmaster>
    <generator>MATLAB Central Newsreader</generator>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
    <ttl>60</ttl>
    <image>
      <title>MathWorks</title>
      <url>http://www.mathworks.com/images/membrane_icon.gif</url>
    </image>
    <item>
      <pubDate>Tue, 17 Jul 2007 14:51:34 -0400</pubDate>
      <title>clear display</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/152616#383361</link>
      <author>Steve </author>
      <description>I have a loop that takes about 10 minutes to run.  As this takes longer than expected, I would like a simple note displayed on the workspace showing the percentage.  I am successful doing:&lt;br&gt;
&lt;br&gt;
for time=t';    %running time [hr]&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;percent=round(time/size(t,1)*100);&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;display(['Running... ',num2str(percent),'%'])&lt;br&gt;
&lt;br&gt;
The problem is only that each loop displays the note, creating a long list on the workspace.  How can I clear the displayed line at the end of the loop and replace it with the newer one to show a single line with a changing percent done?&lt;br&gt;
&lt;br&gt;
Thanks!</description>
    </item>
    <item>
      <pubDate>Tue, 17 Jul 2007 15:40:24 -0400</pubDate>
      <title>Re: clear display</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/152616#383363</link>
      <author>David </author>
      <description>clc clears the command window if that is what you want to do.</description>
    </item>
    <item>
      <pubDate>Tue, 17 Jul 2007 15:54:38 -0400</pubDate>
      <title>Re: clear display</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/152616#383368</link>
      <author>Steve </author>
      <description>clc isn't quite it.  I'd rather clear just the last line of the command window, not the entire thing.  Any other ideas?</description>
    </item>
    <item>
      <pubDate>Tue, 17 Jul 2007 14:32:06 -0400</pubDate>
      <title>Re: clear display</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/152616#383394</link>
      <author>Loren Shure</author>
      <description>In article &amp;lt;f7il1m$t37$1@fred.mathworks.com&amp;gt;, &lt;br&gt;
steveDEL.bachmeierDEL@yahoo.com says...&lt;br&gt;
&amp;gt; I have a loop that takes about 10 minutes to run.  As this takes longer than expected, I would like a simple note displayed on the workspace showing the percentage.  I am successful doing:&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; for time=t';    %running time [hr]&lt;br&gt;
&amp;gt;     &lt;br&gt;
&amp;gt;     percent=round(time/size(t,1)*100);&lt;br&gt;
&amp;gt;     display(['Running... ',num2str(percent),'%'])&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; The problem is only that each loop displays the note, creating a long list on the workspace.  How can I clear the displayed line at the end of the loop and replace it with the newer one to show a single line with a changing percent done?&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Thanks!&lt;br&gt;
&amp;gt; &lt;br&gt;
&lt;br&gt;
This code illustrates what I think you are after... but I am not sure it &lt;br&gt;
will be quite what you want. If you don't have the pause in, you won't &lt;br&gt;
see anything but the last statement because MATLAB tries to be efficient &lt;br&gt;
about not writing to the command window &quot;too often.&quot;&lt;br&gt;
&lt;br&gt;
fprintf(1,'here''s my integer:  ');&lt;br&gt;
for i=1:9&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;fprintf(1,'\b%d',i); pause(.1)&lt;br&gt;
end&lt;br&gt;
fprintf('\n')&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
-- Loren&lt;br&gt;
&lt;a href=&quot;http://blogs.mathworks.com/loren/&quot;&gt;http://blogs.mathworks.com/loren/&lt;/a&gt;</description>
    </item>
    <item>
      <pubDate>Tue, 17 Jul 2007 20:28:48 -0400</pubDate>
      <title>Re: clear display</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/152616#383413</link>
      <author>Fangjun Jiang</author>
      <description>the function waitbar() may be a good choice for your need.</description>
    </item>
    <item>
      <pubDate>Tue, 17 Jul 2007 21:38:06 -0400</pubDate>
      <title>Re: clear display</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/152616#383422</link>
      <author>Steve </author>
      <description>Both of those work well for me needs.  Thanks!</description>
    </item>
    <item>
      <pubDate>Thu, 31 Mar 2011 00:04:05 -0400</pubDate>
      <title>Re: clear display</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/152616#828445</link>
      <author>Andrey </author>
      <description>&lt;br&gt;
&amp;gt; fprintf(1,'here''s my integer:  ');&lt;br&gt;
&amp;gt; for i=1:9&lt;br&gt;
&amp;gt;     fprintf(1,'\b%d',i); pause(.1)&lt;br&gt;
&amp;gt; end&lt;br&gt;
&amp;gt; fprintf('\n')&lt;br&gt;
&amp;gt; &lt;br&gt;
&lt;br&gt;
This is great, thanks!!</description>
    </item>
  </channel>
</rss>

