Maximal number of elements in the history table
The environment variable HISTORY determines the maximal number of entries of the history table at interactive level.
Possible values: Nonnegative integer smaller than 231.
The commands that are entered interactively in a MuPAD® session, executed in a procedure, or read from a file, as well as the resulting MuPAD outputs are stored in an internal data structure, the history table. Only the most recent entries are kept in memory.
Within a procedure, the maximal number of entries in the local history table of the procedure is always 3, independent of the value of HISTORY.
In the following example, we set the value of HISTORY to 2. Afterwards, only the two most recent inputs and outputs are stored in the history table at interactive level:
HISTORY := 2: a := 1: b := 2: max(a, b): history(history() - 1), history(history())
The attempt to access the third last entry in the history table leads to an error:
history(history() - 2)
Error: The argument is invalid. [history]
We use delete to restore the default value of HISTORY:
delete HISTORY: HISTORY