204 Appendix A: Functions and Instructions
Local CATALOG
Local
var1
[,
var2
] [,
var3
] ...
Declares the specified
vars
as local variables.
Those variables exist only during evaluation of a
program or function and are deleted when the
program or function finishes execution.
Note: Local variables save memory because they
only exist temporarily. Also, they do not disturb
any existing global variable values. Local
variables must be used for
For loops and for
temporarily saving values in a multi-line function
since modifications on global variables are not
allowed in a function.
Program listing:
:prgmname()
:Prgm
:Local x,y
:Input "Enter x",x
:Input "Enter y",y
:Disp xù y
:EndPrgm
Note:
x
and
y
do not exist after the program
executes.
Lock CATALOG
Lock
var1
[,
var2
] ...
Locks the specified variables. This prevents you
from accidentally deleting or changing the
variable without first using the unlock instruction
on that variable.
In the example to the right, the variable L1 is
locked and cannot be deleted or modified.
Note: The variables can be unlocked using the
Unlock command.
{1,2,3,4}! L1 ¸ {1,2,3,4}
Lock L1
¸ Done
DelVar L1
¸
Error:
Variable is locked or protected
log() CATALOG
log(
expression1
) ⇒
expression
log(
list1
) ⇒
list
Returns the base-10 logarithm of the argument.
For a list, returns the base-10 logs of the
elements.
log(2.0) ¸ .301...
If complex format mode is
REAL:
log({ë 3,1.2,5}) ¸
Error: Non-real result
If complex format mode is RECTANGULAR:
log({ë 3,1.2,5}) ¸
{
ln(3)
ln(10)
+
p
ln(10)
øi .079...
ln(5)
ln(10)
}
log(
squareMatrix1
) ⇒
squareMatrix
Returns the matrix base-10 logarithm of
squareMatrix1
. This is
not
the same as calculating
the base-10 logarithm of each element. For
information about the calculation method, refer
to
cos().
squareMatrix1
must be diagonalizable. The result
always contains floating-point numbers.
In Radian angle mode and Rectangular
complex format mode:
log([1,5,3;4,2,1;6,ë 2,1]) ¸
.795…+.753…øi .003…ì.647…øi …
.194…ì.315…øi .462…+.270øi …
ë.115…ì.904…øi .488…+.777…øi …