Why do some of the entries in history.m get erased arbitrarily?

1 view (last 30 days)
Based on the documentation, I expect the command history file to grow to 200KB, and overwrite the oldest commands first after that.  However, my experience is that the size of the file is on average between 4 to 6 KB, and never reaches the documented 200 KB size.  I also notice that some of the oldest commands are missing sometimes.  Running a job using MATLAB in the "-nodesktop" mode, and seems to be the cause of the file shrinking.  If I have an interactive session of MATLAB open, no commands are lost.  What could be causing this?

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 24 Nov 2014
The old implementation of the "-nodesktop" history has a 4 KB  limit and writes to the same "history.m" file as the desktop command history.  As of MATLAB R2014a, the desktop writes to a different file, "history.xml", and therefore the commands will not be lost due to running in "-nodesktop" mode.
With older versions of MATLAB, to avoid losing entries in 'history.m', either:
1) Avoid running in -nodesktop mode when possible.
2) Temporarily move the 'history.m' to a different directory before launching MATLAB in "-nodesktop" mode, then copy it back to the original location later.

More Answers (0)

Categories

Find more on Startup and Shutdown in Help Center and File Exchange

Tags

No tags entered yet.

Products


Release

R2012b

Community Treasure Hunt

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

Start Hunting!