MATLAB Answers


How can I show a time/date stamp in the prompt?

I am recording (using diary) some work in MATLAB and I want to see when each command was executed. Is there a way to change the prompt (similar to the unix prompt) to show date/time?
Ideally it would look like this
3/15/2012 4:00 pm>> 1
ans =
3/15/2012 4:01 pm>> _


Sign in to comment.

1 Answer

Answer by Oleg Komarov on 16 Mar 2012
 Accepted Answer

Has link to FEX submission.
setPrompt([datestr(now,'mm/dd/yyyy HH:MM PM') ' >> '])
To make it "permanent" place it in the startup.m file.

  1 Comment

Thanks! direct link to FEX for others:

Sign in to comment.