Path: news.mathworks.com!newsfeed-00.mathworks.com!news.kjsl.com!newsfeed.stanford.edu!news.stanford.edu!not-for-mail
From: "huhua" <lunamoonmoon@gmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: how to make command history permanent?
Date: Tue, 3 Jun 2008 17:51:46 -0700
Lines: 64
Message-ID: <g24ouv$v47$1@news.stanford.edu>
References: <g21skv$vhc$1@news.stanford.edu> <86752402-6902-4f73-bf7d-429ac8b16771@s50g2000hsb.googlegroups.com> <g23gqj$8qb$1@fred.mathworks.com>
NNTP-Posting-Host: comtech-2007.stanford.edu
X-Trace: news.stanford.edu 1212540703 31879 171.64.113.16 (4 Jun 2008 00:51:43 GMT)
X-Complaints-To: news@news.stanford.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3138
X-RFC2646: Format=Flowed; Response
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198
Xref: news.mathworks.com comp.soft-sys.matlab:472086




"Steven Lord" <slord@mathworks.com> wrote in message 
news:g23gqj$8qb$1@fred.mathworks.com...
>
> "Rune Allnor" <allnor@tele.ntnu.no> wrote in message 
> news:86752402-6902-4f73-bf7d-429ac8b16771@s50g2000hsb.googlegroups.com...
>> On 3 Jun, 00:36, "huhua" <lunamoonm...@gmail.com> wrote:
>>> Hi all,
>>>
>>> The current Matlab command history window only keeps a small number of
>>> command histories. Is there a way to make all the history entries kept
>>> permanently?
>
> No, not unless you make a backup copy of the M-file in your PREFDIR that 
> contains the command history periodically.
>
>> Maybe not exactly what you want, but something
>> close. In the mid/late '90s I used to use the
>> DIARY to save my commands.
>>
>> You can do something like this in startup.m:
>>
>> diaryname=['matlab-session-log-',date];
>> diary(diaryname);
>> clear diaryname;
>>
>> Everything that goes on in the command window
>> is mow logged to the specified file, including
>> output as well as commands.
>
> You can do something similar when you start MATLAB by using the -logfile 
> option.
>
> http://www.mathworks.com/access/helpdesk/help/techdoc/ref/matlabwindows.html
>
> http://www.mathworks.com/access/helpdesk/help/techdoc/ref/matlabunix.html
>
> *snip*
>
> -- 
> Steve Lord
> slord@mathworks.com
>
>


Thanks! But I don't like log all the outputs. Because that's going to be 
huge. I just want all the command histories.

For example, I have been desperately looking for my command history back to 
Dec. 2007.

But I couldn't find anywhere. I got to know that Matlab command history has 
a default length limit of 20K, which is bad desgin.

I think it should just allow an infinite amount of command history to be 
saved.

Why cares about the size of those texts today with large harddisk? The most 
important is the convenience of being able to dig out which command one has 
used a few months ago.