Site icon TestingDocs.com

Octave who command

Overview

Octave who command is a built-in function to list currently defined variables matching the given pattern.

Syntax

>> who
>> 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.

Example

>> x1=10;
>> x2=12.5;
>> who
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.

>> whos

 

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:

https://www.testingdocs.com/octave-clear-command/

Octave Tutorials

Octave Tutorial on this website can be found at:
https://www.testingdocs.com/octave-tutorial/

More information on Octave can be found on the official website:
https://www.gnu.org/software/octave/index

Exit mobile version