Clear the remember table of a procedure
This functionality does not run in MATLAB.
forget(f) clears the remember table of a procedure f. The forget function clears only remember tables created by the option remember.
Do not call the forget function for predefined MuPAD® functions. Many predefined MuPAD functions have special values stored in their remember tables. The forget function does not throw an error when you call it for a predefined MuPAD function.
The forget function does not work recursively. If an inner procedure in a nested procedure uses the option remember, the forget function does not clear the remember table created for the inner procedure.
If you use the option remember in a procedure, MuPAD stores all input arguments you used in the procedure calls as indices of the remember table, and the corresponding results as values of these entries. For example, create the following procedure f as a wrapper for the MuPAD sign function. Use the option remember to enable the remember mechanism for the procedure f:
f := proc(x) option remember; begin sign(x) end:
Now compute the sign function for the values -1, 0, and 1:
f(-1), f(0), f(1)
unprotect(sign): sign(0):= 1/2:
Although you specified the new value for sign(0), MuPAD does not recalculate the result of the function call f(0). Instead, the system returns the result stored in the remember table:
To clear a remember table created by the option remember, use the forget function:
If you assign a value to a function call, calling the forget function also clears that value:
f(2) := 1/3: f(2)
For further computations, restore the sign function to its default definition. Use the protect function with the ProtectLevelError option to prevent further changes to sign. Also, delete the procedure f:
sign(0):= 0: protect(sign, ProtectLevelError): delete f
Void object of domain type DOM_NULL