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

11 次查看(过去 30 天)
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 =
1
3/15/2012 4:01 pm>> _
Thanks!

采纳的回答

Oleg Komarov
Oleg Komarov 2012-3-16
Has link to FEX submission.
EDIT
setPrompt([datestr(now,'mm/dd/yyyy HH:MM PM') ' >> '])
To make it "permanent" place it in the startup.m file.
  1 个评论
Alex Feinman
Alex Feinman 2012-3-16
Thanks! direct link to FEX for others: http://www.mathworks.com/matlabcentral/fileexchange/26471

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Dates and Time 的更多信息

产品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by