Delete the names matching the given patterns from the symbol table. The pattern may contain the following special characters:
- Match any single character.
- Match zero or more characters.
- Match the list of characters specified by list. If the first character is
^, match all characters except those specified by list. For example, the pattern `[a-zA-Z]' will match all lower and upper case alphabetic characters.
For example, the commandclear foo b*r
clears the name
fooand all names that begin with the letter
band end with the letter
clearis called without any arguments, all user-defined variables (local and global) are cleared from the symbol table. If
clearis called with at least one argument, only the visible names matching the arguments are cleared. For example, suppose you have defined a function
foo, and then hidden it by performing the assignment
foo = 2. Executing the command clear foo once will clear the variable definition and restore the definition of
fooas a function. Executing clear foo a second time will clear the function definition.
With -x, clear the variables that don't match the patterns.
This command may not be used within a function body.
List currently defined symbols matching the given patterns. The following are valid options. They may be shortened to one character but may not be combined.
- List all currently defined symbols.
- List built-in variables and functions. This includes all currently compiled function files, but does not include all function files that are in the
- List user-defined functions.
- Print a long listing including the type and dimensions of any symbols. The symbols in the first column of output indicate whether it is possible to redefine the symbol, and whether it is possible for it to be cleared.
- List user-defined variables.
Valid patterns are the same as described for the
clearcommand above. If no patterns are supplied, all symbols from the given category are listed. By default, only user defined functions and variables visible in the local scope are displayed.
The command whos is equivalent to who -long.
This string decides in what order attributtes of variables are to be printed. The following commands are used:
- Prints number of bytes occupied by variables.
- Prints elements held by variables.
- Prints variable names.
- Prints protection attributtes of variables.
- Prints dimensions of variables.
- Prints type names of variables.
Every command may also have a modifier:
- Left alignment.
- Right alignment (this is the default).
- Centered (may only be applied to command %s).
A command is composed like this: %[modifier]<command>[:size_of_parameter[:center-specific[:print_dims[:balance]]]];
Command and modifier is already explained. Size_of_parameter tells how many columns the parameter will need for printing. print_dims tells how many dimensions to print. If number of dimensions exceeds print_dims, dimensions will be printed like x-D. center-specific and print_dims may only be applied to command %s. A negative value for print_dims will cause Octave to print all dimensions whatsoever. balance specifies the offset for printing of the dimensions string.
Default format is " %p:4; %ln:6; %cs:16:6:8:1; %rb:12; %lt:-1;\n".
Return 1 if the name exists as a variable, 2 if the name (after appending `.m') is a function file in Octave's LOADPATH, 3 if the name is a `.oct' file in Octave's LOADPATH, 5 if the name is a built-in function, 7 if the name is a directory, 101 if the name is a built-in variable, 102 if the name is a built-in constant, or 103 if the name is a function not associated with a file (entered on the command line).
Otherwise, return 0.
This function also returns 2 if a regular file called name exists in Octave's
LOADPATH. If you want information about other types of files, you should use some combination of the functions
If the optional argument type is supplied, check only for symbols of the specified type. Valid types are
- Check only for variables.
- Check only for built-in functions.
- Check only for files.
- Check only for directories.
Display the definition of each name that refers to a function.
Normally also displays if each name is user-defined or builtin; the
-qoption suppresses this behaviour.
Currently, Octave can only display functions that can be compiled cleanly, because it uses its internal representation of the function to recreate the program text.
Comments are not displayed because Octave's parser currently discards them as it converts the text of a function file to its internal representation. This problem may be fixed in a future release.