Thread Subject:
Command History

Subject: Command History

From: Chad Bernier

Date: 5 Jul, 2012 20:42:31

Message: 1 of 4

Hello. I haven't posted in this group in a long time, but I still work with MATLAB on a daily basis. I am wondering if any of you have solved a little problem of mine.

MATLAB time stamps the command history every time it is started up. The problem is that is the only time it does that. Some days I might start MATLAB 5 times in one day. Other times, a single session of MATLAB might last 5 weeks before I have to restart the computer for some reason. Is there a way I could make it time stamp the command history at least once per day on it's own? Other than making it a habit to close down my MATLAB every night and reopen it in the morning. It would be cool if I could set it on a timer, to time stamp at say midnight. If that isn't possible, could I have a simple command (like put it in a script or something), that I could try to remember to run everyday before leaving the lab, and whenever else I want? This would be great. So if you could remember that you did something say last Tuesday, you could find the section for that day and find the code you ran.

Subject: Command History

From: dpb

Date: 5 Jul, 2012 21:00:44

Message: 2 of 4

On 7/5/2012 3:42 PM, Chad Bernier wrote:
...

> MATLAB time stamps the command history every time it is started up.
> The problem is that is the only time it does that. ...
> ...
> Is there a way I could make it time stamp the command history at
> least once per day on it's own? Other than making it a habit to close
> down my MATLAB every night and reopen it in the morning. It would be
> cool if I could set it on a timer, to time stamp at say midnight. If
> that isn't possible, could I have a simple command (like put it in a
> script or something), that I could try to remember to run everyday
> before leaving the lab, and whenever else I want? This would be great.

It is just a text file, history.m so afaik there's no reason you
couldn't just write a timestamp to it on your own. Simply open it for
append and close the handle when you're done.

--

Subject: Command History

From: Steven_Lord

Date: 5 Jul, 2012 21:26:00

Message: 3 of 4



"Chad Bernier" <chad.r.bernier@gmail.com> wrote in message
news:942094ae-cbf0-4670-ac6a-63594e3b313d@googlegroups.com...
> Hello. I haven't posted in this group in a long time, but I still work
> with MATLAB on a daily basis. I am wondering if any of you have solved a
> little problem of mine.
>
> MATLAB time stamps the command history every time it is started up. The
> problem is that is the only time it does that. Some days I might start
> MATLAB 5 times in one day. Other times, a single session of MATLAB might
> last 5 weeks before I have to restart the computer for some reason. Is
> there a way I could make it time stamp the command history at least once
> per day on it's own? Other than making it a habit to close down my MATLAB
> every night and reopen it in the morning. It would be cool if I could set
> it on a timer, to time stamp at say midnight. If that isn't possible,
> could I have a simple command (like put it in a script or something), that
> I could try to remember to run everyday before leaving the lab, and
> whenever else I want? This would be great. So if you could remember that
> you did something say last Tuesday, you could find the section for that
> day and find the code you ran.

I don't believe the Command History offers that capability, but it seems
like a reasonable enhancement request. Since enhancement requests from users
tend to carry more weight in my experience, please send your request to
Technical Support directly. They may even know of a way to do what you're
looking for that I don't know.

--
Steve Lord
slord@mathworks.com
To contact Technical Support use the Contact Us link on
http://www.mathworks.com

Subject: Command History

From: dpb

Date: 6 Jul, 2012 14:21:05

Message: 4 of 4

On 7/5/2012 4:00 PM, dpb wrote:
> On 7/5/2012 3:42 PM, Chad Bernier wrote:
> ....
>
>> MATLAB time stamps the command history every time it is started up.
>> The problem is that is the only time it does that. ...
>> ...
>> Is there a way I could make it time stamp the command history at
>> least once per day on it's own? ...

>
> It is just a text file, history.m so afaik there's no reason you
> couldn't just write a timestamp to it on your own. Simply open it for
> append and close the handle when you're done.
...

And, of course, if you do want an automagic timestamp you could simply
write a small executable or batch file and have the system chron utility
execute it daily or on whatever schedule you wanted. To issue a
timestamp from within Matlab session you would then just bang the
utility name to the OS...

All this assumes, of course, that TMW hasn't locked the history file for
exclusive access. If so, is there a way to close and reopen it w/o
losing the previous content I'd hope?

--

Tags for this Thread

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

rssFeed for this Thread

Contact us