Previous Up Next

3.3.9  Unassigning variables

Xcas has commands that help you keep track of what variables you are using and resetting them if desired. The VARS command will list all the variables that you are using, the purge, DelVar and del commands will delete selected variables, and the rm_a_z and rm_all_vars commands will remove classes of variables. All variables can be removed by using restart.

The purge command will clear the values and assumptions you make on variables (see Section 3.3.8). For TI compatibility there is also DelVar, and for Python compatibility there is del.

The rm_all_vars and restart commands clear the values and assumptions you have made on all variables use.

The rm_a_z command clears the values and assumptions on all variables with single lowercase letter names.

Examples

Enter:

a:=1; anothervar:=2

then:

VARS()
     

a,anothervar
          

To clear the variable a:

purge(a)

or (for TI compatibility):

DelVar a

or (for Python compatibility):

del a

If you have variables names A,B,a,b,myvar, then after:

rm_a_z()

you will only have the variables named A,B,myvar.


Previous Up Next