<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/170351</link>
    <title>MATLAB Central Newsreader - how to make command history permanent?</title>
    <description>Feed for thread: how to make command history permanent?</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>Mon, 02 Jun 2008 22:36:14 -0400</pubDate>
      <title>how to make command history permanent?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/170351#435523</link>
      <author>huhua</author>
      <description>Hi all,&lt;br&gt;
&lt;br&gt;
The current Matlab command history window only keeps a small number of &lt;br&gt;
command histories. Is there a way to make all the history entries kept &lt;br&gt;
permanently?&lt;br&gt;
&lt;br&gt;
Thanks! </description>
    </item>
    <item>
      <pubDate>Tue, 03 Jun 2008 10:07:44 -0400</pubDate>
      <title>Re: how to make command history permanent?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/170351#435580</link>
      <author>Rune Allnor</author>
      <description>On 3 Jun, 00:36, &quot;huhua&quot; &amp;lt;lunamoonm...@gmail.com&amp;gt; wrote:&lt;br&gt;
&amp;gt; Hi all,&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; The current Matlab command history window only keeps a small number of&lt;br&gt;
&amp;gt; command histories. Is there a way to make all the history entries kept&lt;br&gt;
&amp;gt; permanently?&lt;br&gt;
&lt;br&gt;
Maybe not exactly what you want, but something&lt;br&gt;
close. In the mid/late '90s I used to use the&lt;br&gt;
DIARY to save my commands.&lt;br&gt;
&lt;br&gt;
You can do something like this in startup.m:&lt;br&gt;
&lt;br&gt;
diaryname=['matlab-session-log-',date];&lt;br&gt;
diary(diaryname);&lt;br&gt;
clear diaryname;&lt;br&gt;
&lt;br&gt;
Everything that goes on in the command window&lt;br&gt;
is mow logged to the specified file, including&lt;br&gt;
output as well as commands.&lt;br&gt;
&lt;br&gt;
This archive saved me on numerous occations,&lt;br&gt;
but the files tend to be large if you work&lt;br&gt;
a lot with matlab, not to mention if you&lt;br&gt;
accidently print out a 100 MB array to the&lt;br&gt;
command window. So use this logging system&lt;br&gt;
very cautiosly unless you have a very large&lt;br&gt;
disk!&lt;br&gt;
&lt;br&gt;
Maybe not as big a problem nowadays with the PC&lt;br&gt;
as it used to be on the UNIX servers, but if you&lt;br&gt;
stay logged in for days as I used to back then,&lt;br&gt;
be aware that the date of the file is set when&lt;br&gt;
matlab is started, not when the work is done.&lt;br&gt;
&lt;br&gt;
Rune</description>
    </item>
    <item>
      <pubDate>Tue, 03 Jun 2008 13:26:43 -0400</pubDate>
      <title>Re: how to make command history permanent?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/170351#435617</link>
      <author>Steven Lord</author>
      <description>&lt;br&gt;
&quot;Rune Allnor&quot; &amp;lt;allnor@tele.ntnu.no&amp;gt; wrote in message &lt;br&gt;
news:86752402-6902-4f73-bf7d-429ac8b16771@s50g2000hsb.googlegroups.com...&lt;br&gt;
&amp;gt; On 3 Jun, 00:36, &quot;huhua&quot; &amp;lt;lunamoonm...@gmail.com&amp;gt; wrote:&lt;br&gt;
&amp;gt;&amp;gt; Hi all,&lt;br&gt;
&amp;gt;&amp;gt;&lt;br&gt;
&amp;gt;&amp;gt; The current Matlab command history window only keeps a small number of&lt;br&gt;
&amp;gt;&amp;gt; command histories. Is there a way to make all the history entries kept&lt;br&gt;
&amp;gt;&amp;gt; permanently?&lt;br&gt;
&lt;br&gt;
No, not unless you make a backup copy of the M-file in your PREFDIR that &lt;br&gt;
contains the command history periodically.&lt;br&gt;
&lt;br&gt;
&amp;gt; Maybe not exactly what you want, but something&lt;br&gt;
&amp;gt; close. In the mid/late '90s I used to use the&lt;br&gt;
&amp;gt; DIARY to save my commands.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; You can do something like this in startup.m:&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; diaryname=['matlab-session-log-',date];&lt;br&gt;
&amp;gt; diary(diaryname);&lt;br&gt;
&amp;gt; clear diaryname;&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Everything that goes on in the command window&lt;br&gt;
&amp;gt; is mow logged to the specified file, including&lt;br&gt;
&amp;gt; output as well as commands.&lt;br&gt;
&lt;br&gt;
You can do something similar when you start MATLAB by using the -logfile &lt;br&gt;
option.&lt;br&gt;
&lt;br&gt;
&lt;a href=&quot;http://www.mathworks.com/access/helpdesk/help/techdoc/ref/matlabwindows.html&quot;&gt;http://www.mathworks.com/access/helpdesk/help/techdoc/ref/matlabwindows.html&lt;/a&gt;&lt;br&gt;
&lt;br&gt;
&lt;a href=&quot;http://www.mathworks.com/access/helpdesk/help/techdoc/ref/matlabunix.html&quot;&gt;http://www.mathworks.com/access/helpdesk/help/techdoc/ref/matlabunix.html&lt;/a&gt;&lt;br&gt;
&lt;br&gt;
*snip*&lt;br&gt;
&lt;br&gt;
-- &lt;br&gt;
Steve Lord&lt;br&gt;
slord@mathworks.com </description>
    </item>
    <item>
      <pubDate>Wed, 04 Jun 2008 00:51:46 -0400</pubDate>
      <title>Re: how to make command history permanent?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/170351#435740</link>
      <author>huhua</author>
      <description>&lt;br&gt;
&quot;Steven Lord&quot; &amp;lt;slord@mathworks.com&amp;gt; wrote in message &lt;br&gt;
news:g23gqj$8qb$1@fred.mathworks.com...&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &quot;Rune Allnor&quot; &amp;lt;allnor@tele.ntnu.no&amp;gt; wrote in message &lt;br&gt;
&amp;gt; news:86752402-6902-4f73-bf7d-429ac8b16771@s50g2000hsb.googlegroups.com...&lt;br&gt;
&amp;gt;&amp;gt; On 3 Jun, 00:36, &quot;huhua&quot; &amp;lt;lunamoonm...@gmail.com&amp;gt; wrote:&lt;br&gt;
&amp;gt;&amp;gt;&amp;gt; Hi all,&lt;br&gt;
&amp;gt;&amp;gt;&amp;gt;&lt;br&gt;
&amp;gt;&amp;gt;&amp;gt; The current Matlab command history window only keeps a small number of&lt;br&gt;
&amp;gt;&amp;gt;&amp;gt; command histories. Is there a way to make all the history entries kept&lt;br&gt;
&amp;gt;&amp;gt;&amp;gt; permanently?&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; No, not unless you make a backup copy of the M-file in your PREFDIR that &lt;br&gt;
&amp;gt; contains the command history periodically.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt;&amp;gt; Maybe not exactly what you want, but something&lt;br&gt;
&amp;gt;&amp;gt; close. In the mid/late '90s I used to use the&lt;br&gt;
&amp;gt;&amp;gt; DIARY to save my commands.&lt;br&gt;
&amp;gt;&amp;gt;&lt;br&gt;
&amp;gt;&amp;gt; You can do something like this in startup.m:&lt;br&gt;
&amp;gt;&amp;gt;&lt;br&gt;
&amp;gt;&amp;gt; diaryname=['matlab-session-log-',date];&lt;br&gt;
&amp;gt;&amp;gt; diary(diaryname);&lt;br&gt;
&amp;gt;&amp;gt; clear diaryname;&lt;br&gt;
&amp;gt;&amp;gt;&lt;br&gt;
&amp;gt;&amp;gt; Everything that goes on in the command window&lt;br&gt;
&amp;gt;&amp;gt; is mow logged to the specified file, including&lt;br&gt;
&amp;gt;&amp;gt; output as well as commands.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; You can do something similar when you start MATLAB by using the -logfile &lt;br&gt;
&amp;gt; option.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &lt;a href=&quot;http://www.mathworks.com/access/helpdesk/help/techdoc/ref/matlabwindows.html&quot;&gt;http://www.mathworks.com/access/helpdesk/help/techdoc/ref/matlabwindows.html&lt;/a&gt;&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &lt;a href=&quot;http://www.mathworks.com/access/helpdesk/help/techdoc/ref/matlabunix.html&quot;&gt;http://www.mathworks.com/access/helpdesk/help/techdoc/ref/matlabunix.html&lt;/a&gt;&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; *snip*&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; -- &lt;br&gt;
&amp;gt; Steve Lord&lt;br&gt;
&amp;gt; slord@mathworks.com&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt;&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
Thanks! But I don't like log all the outputs. Because that's going to be &lt;br&gt;
huge. I just want all the command histories.&lt;br&gt;
&lt;br&gt;
For example, I have been desperately looking for my command history back to &lt;br&gt;
Dec. 2007.&lt;br&gt;
&lt;br&gt;
But I couldn't find anywhere. I got to know that Matlab command history has &lt;br&gt;
a default length limit of 20K, which is bad desgin.&lt;br&gt;
&lt;br&gt;
I think it should just allow an infinite amount of command history to be &lt;br&gt;
saved.&lt;br&gt;
&lt;br&gt;
Why cares about the size of those texts today with large harddisk? The most &lt;br&gt;
important is the convenience of being able to dig out which command one has &lt;br&gt;
used a few months ago.</description>
    </item>
    <item>
      <pubDate>Wed, 04 Jun 2008 01:38:01 -0400</pubDate>
      <title>Re: how to make command history permanent?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/170351#435742</link>
      <author>Matt Fig</author>
      <description>&amp;nbsp;&amp;gt; Thanks! But I don't like log all the outputs. Because&lt;br&gt;
that's going to be &lt;br&gt;
&amp;gt; huge. I just want all the command histories.&lt;br&gt;
&lt;br&gt;
&amp;gt;I got to know that Matlab command history has &lt;br&gt;
&amp;gt; a default length limit of 20K, which is bad desgin.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; I think it should just allow an infinite amount of command&lt;br&gt;
history to be &lt;br&gt;
&amp;gt; saved.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Why cares about the size of those texts today with large&lt;br&gt;
harddisk? The most &lt;br&gt;
&amp;gt; important is the convenience of being able to dig out&lt;br&gt;
which command one has &lt;br&gt;
&amp;gt; used a few months ago.&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
Your statements don't seem to add up.  You are worried about&lt;br&gt;
saving output because it will be &quot;huge,&quot; but you vent&lt;br&gt;
against Matlab's &quot;bad design&quot; for not storing &quot;infinite&quot;&lt;br&gt;
command history?  What is &quot;huge&quot; next to &quot;infinite?&quot;  &lt;br&gt;
&lt;br&gt;
I too had to learn the hard way.  If you are doing something&lt;br&gt;
that is valuable (or complex) and you think you may need for&lt;br&gt;
future reference, save it in a script file.</description>
    </item>
    <item>
      <pubDate>Wed, 04 Jun 2008 07:22:02 -0400</pubDate>
      <title>Re: how to make command history permanent?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/170351#435758</link>
      <author>Bjorn Gustavsson</author>
      <description>&quot;Matt Fig&quot; &amp;lt;spamanon@yahoo.com&amp;gt; wrote in message&lt;br&gt;
&amp;lt;g24rlp$m7v$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt;  &amp;gt; Thanks! But I don't like log all the outputs. Because&lt;br&gt;
&amp;gt; that's going to be &lt;br&gt;
&amp;gt; &amp;gt; huge. I just want all the command histories.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &amp;gt;I got to know that Matlab command history has &lt;br&gt;
&amp;gt; &amp;gt; a default length limit of 20K, which is bad desgin.&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; I think it should just allow an infinite amount of command&lt;br&gt;
&amp;gt; history to be &lt;br&gt;
&amp;gt; &amp;gt; saved.&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; Why cares about the size of those texts today with large&lt;br&gt;
&amp;gt; harddisk? The most &lt;br&gt;
&amp;gt; &amp;gt; important is the convenience of being able to dig out&lt;br&gt;
&amp;gt; which command one has &lt;br&gt;
&amp;gt; &amp;gt; used a few months ago.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Your statements don't seem to add up.  You are worried about&lt;br&gt;
&amp;gt; saving output because it will be &quot;huge,&quot; but you vent&lt;br&gt;
&amp;gt; against Matlab's &quot;bad design&quot; for not storing &quot;infinite&quot;&lt;br&gt;
&amp;gt; command history?  What is &quot;huge&quot; next to &quot;infinite?&quot;  &lt;br&gt;
&amp;gt; &lt;br&gt;
Seriously MAtt, it is after all a question of how _fast_&lt;br&gt;
things grow. For this statement:&lt;br&gt;
&lt;br&gt;
A = ones(1e4)&lt;br&gt;
&lt;br&gt;
we dont really need the output, do we?&lt;br&gt;
Bjorn</description>
    </item>
    <item>
      <pubDate>Wed, 04 Jun 2008 10:40:49 -0400</pubDate>
      <title>Re: how to make command history permanent?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/170351#435782</link>
      <author>Rune Allnor</author>
      <description>On 4 Jun, 03:38, &quot;Matt Fig&quot; &amp;lt;spama...@yahoo.com&amp;gt; wrote:&lt;br&gt;
&amp;gt; =A0&amp;gt; Thanks! But I don't like log all the outputs. Because&lt;br&gt;
&amp;gt; that's going to be&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; huge. I just want all the command histories.&lt;br&gt;
&amp;gt; &amp;gt;I got to know that Matlab command history has&lt;br&gt;
&amp;gt; &amp;gt; a default length limit of 20K, which is bad desgin.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; I think it should just allow an infinite amount of command&lt;br&gt;
&amp;gt; history to be&lt;br&gt;
&amp;gt; &amp;gt; saved.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; Why cares about the size of those texts today with large&lt;br&gt;
&amp;gt; harddisk? The most&lt;br&gt;
&amp;gt; &amp;gt; important is the convenience of being able to dig out&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; which command one has&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; used a few months ago.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Your statements don't seem to add up.&lt;br&gt;
&lt;br&gt;
Having been where the OP seems to be, I can assure you&lt;br&gt;
the statements add up!&lt;br&gt;
&lt;br&gt;
&amp;gt;=A0You are worried about&lt;br&gt;
&amp;gt; saving output because it will be &quot;huge,&quot;&lt;br&gt;
&lt;br&gt;
Others already commented on that...&lt;br&gt;
&lt;br&gt;
&amp;gt; but you vent&lt;br&gt;
&amp;gt; against Matlab's &quot;bad design&quot; for not storing &quot;infinite&quot;&lt;br&gt;
&amp;gt; command history? =A0What is &quot;huge&quot; next to &quot;infinite?&quot; =A0&lt;br&gt;
&lt;br&gt;
There is a limit to how much input a human can supply&lt;br&gt;
through the command line, maybe a few kB per day.&lt;br&gt;
The output can be immense.&lt;br&gt;
&lt;br&gt;
&amp;gt; I too had to learn the hard way. =A0If you are doing something&lt;br&gt;
&amp;gt; that is valuable (or complex) and you think you may need for&lt;br&gt;
&amp;gt; future reference, save it in a script file.&lt;br&gt;
&lt;br&gt;
That's what I do these days. One problem with thit&lt;br&gt;
approach is that I often run the scripts from the&lt;br&gt;
Editor window by pressing the F5 key. Thise events&lt;br&gt;
are not logged in neither the command history nor&lt;br&gt;
diary, since the command window is bypassed.&lt;br&gt;
&lt;br&gt;
I would suggest that somebody who has the privelege to&lt;br&gt;
submit a product enhancement request (I don't as I didn't&lt;br&gt;
renew the matlab support agreement) asks for a modification&lt;br&gt;
such that commands (including F5's in the editor window)&lt;br&gt;
are logged in a specified file, which the user can specify&lt;br&gt;
in startup.m.&lt;br&gt;
&lt;br&gt;
All the functionality necessary to make such a feature&lt;br&gt;
is already there, it's just a matter of putting the&lt;br&gt;
pieces together.&lt;br&gt;
&lt;br&gt;
Rune</description>
    </item>
  </channel>
</rss>

