Delete the value of an identifier
This functionality does not run in MATLAB.
delete x1, x2, … _delete(x1, x2, …)
The statement delete x deletes the value of the identifier x.
For many computations, symbolic variables are needed. E.g., solving an equation for an unknown x requires an identifier x that does not have a value. If x has a value, the statement delete x deletes the value and x can be used as a symbolic variable.
The statement delete x1, x2, ... is equivalent to the function call _delete(x1, x2, ...). The values of all specified identifiers are deleted.
The identifiers x, y are assigned values. After deletion, the identifiers have no values any longer:
x := 42: y := 7: delete x: x, y
delete y: x, y
More than one identifier can be deleted by one call:
a := b := c := 42: a, b, c
delete a, b, c: a, b, c
L := [7, 13, 42]
delete L: L
A := array(1..3, [7, 13, 42])
delete A: A, A
T := table(1 = 7, 2 = 13, 3 = 42)
delete T: T
Note that delete does not evaluate the objects that are to be deleted. In the following, an element of the list U is deleted. The original value of U (the list L) is not changed:
U := L: delete U: U, L
Finally, all assigned values are deleted:
delete U, L, A, T: U, L, A, T
delete can also be used to delete properties of identifiers set via assume. With the assumption "x > 1", the expression ln(x) has the property "ln(x) > 0", i.e., its sign is 1:
assume(x > 1): sign(ln(x))
Without a property of x, the function sign cannot determine the sign of ln(x):
delete x: sign(ln(x))
Void object of type DOM_NULL.