Path: news.mathworks.com!newsfeed-00.mathworks.com!newsfeed2.dallas1.level3.net!news.level3.com!postnews.google.com!s50g2000hsb.googlegroups.com!not-for-mail
From: Rune Allnor <allnor@tele.ntnu.no>
Newsgroups: comp.soft-sys.matlab
Subject: Re: how to make command history permanent?
Date: Tue, 3 Jun 2008 03:07:44 -0700 (PDT)
Organization: http://groups.google.com
Lines: 36
Message-ID: <86752402-6902-4f73-bf7d-429ac8b16771@s50g2000hsb.googlegroups.com>
References: <g21skv$vhc$1@news.stanford.edu>
NNTP-Posting-Host: 212.17.141.53
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
X-Trace: posting.google.com 1212487664 24516 127.0.0.1 (3 Jun 2008 10:07:44 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Tue, 3 Jun 2008 10:07:44 +0000 (UTC)
Complaints-To: groups-abuse@google.com
Injection-Info: s50g2000hsb.googlegroups.com; posting-host=212.17.141.53; 
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET 
Xref: news.mathworks.com comp.soft-sys.matlab:471926



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?

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.

This archive saved me on numerous occations,
but the files tend to be large if you work
a lot with matlab, not to mention if you
accidently print out a 100 MB array to the
command window. So use this logging system
very cautiosly unless you have a very large
disk!

Maybe not as big a problem nowadays with the PC
as it used to be on the UNIX servers, but if you
stay logged in for days as I used to back then,
be aware that the date of the file is set when
matlab is started, not when the work is done.

Rune