Matlab command history question

4 次查看(过去 30 天)
Hossein
Hossein 2015-7-17
Hi everyone,
is there any way to recall a command of a long time ago fast and without searching back day by day or is there any log file which saves the command history externally in R2014a?
many thanks in advance

回答(3 个)

Sean de Wolski
Sean de Wolski 2015-7-17
Search it directly!
  2 个评论
Hossein
Hossein 2015-7-17
it's not possible what I need belongs to nearly one year ago and I can not find it anymore in my command history directly!
Sean de Wolski
Sean de Wolski 2015-7-17
Then it's probably gone. The XML file that holds the command history only holds X number of lines where X is set in the preferences.

请先登录,再进行评论。


Bjorn Gustavsson
Bjorn Gustavsson 2015-7-17
To make things like such searches possible I have this in my startup.m-file:
filename = fullfile('/home','bjorn','matlabruns',[datestr(clock,30) '.txt']);
diary(filename)
That saves all commandline-input/output in one file for each matlab session. Then I can search for commands and snippets from any-time ago. I find this a very helpful trick - that I learnt by someone very cunning.
HTH - in the future at least

Azzi Abdelmalek
Azzi Abdelmalek 2015-7-17
编辑:Azzi Abdelmalek 2015-7-17
You can find the file history.xml in prefdir
fid=fopen(fullfile(prefdir,'history.xml'))
a=textscan(fid,'%s','delimiter','\n')
fclose(fid)
text=a{:}

类别

Help CenterFile Exchange 中查找有关 Performance and Memory 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by