Octave who command is a built-in function to list currently defined variables matching the given pattern.
>> who [option] pattern …
To know more about the who command.
>> help who
By default, the command lists the variables in the current local scope. To list the global variables we can use the ‘global’ flag to the command.
To display matching variables with a regular expression, we can use the flag ‘-regexp’ followed by the pattern.
Variables visible from the current scope:
ans x1 x2
# To display variables that start with x character.
>> who -regexp ‘x’
We can consider using the whos command to get detailed information about each variable.
The who command displays only the name of the variable. whos command displays detailed information about the variable like name, type, size, storage details, etc in a table format.
The clear command clears all the variables in the session. After the use of the clear command, the who or the whos will not display any variables.
To know more about the clear command:
Octave Tutorial on this website can be found at:
More information on Octave can be found on the official website: