Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I get a list of all the defined variables in Matlab or Octave?

Tags:

matlab

octave

I'm used to working in Matlab using its full GUI environment. Due to license issues I went and installed Octave, but it appears that it doesn't have a GUI, at least not one that's installed by default.

I transferred the variables from Matlab to Octave by saveing them in Matlab and loading them in Octave. Thing is, I don't remember the names because I got used to seeing them in the little workspace window which I no longer have.

How can I see the list of defined variables and their types in Octave?

like image 584
Nathan Fellman Avatar asked Mar 16 '10 19:03

Nathan Fellman


People also ask

How do I find the variable list in MATLAB?

Command Window — To view the value of a variable in the Command Window, type the variable name. For the example, to see the value of a variable n , type n and press Enter. The Command Window displays the variable name and its value. To view all the variables in the current workspace, call the who function.

Which command in MATLAB is used to list variables and their sizes?

When MATLAB® executes the whos command at the end of show_attributes , it lists each variable and its corresponding attribute.

Which command will give a list of global variables MATLAB?

If you type whos at the command line Matlab will list all currently defined variables in your workspace. The last column of output is headed 'Attributes', global variables have the attribute 'global'.

Which MATLAB command clears all the variables stored in work space?

nameN . To clear all variables from the current workspace, use clear or clearvars . To clear all global variables, use clear global or clearvars –global .


Video Answer


3 Answers

The command whos will do just that.

like image 181
Alexander Torstling Avatar answered Oct 12 '22 22:10

Alexander Torstling


With the command whos you can even see the variables that the file has WITHOUT opening the file, to be assure that this file is the one.

For example, the name of the file is MyVariables.mat

use:

whos('-file','MyVariables.mat') 
like image 33
FLemos Avatar answered Oct 12 '22 21:10

FLemos


You can use a GUI similar to Matlab, such as QtOctave or GUIOctave.

like image 41
NoBugs Avatar answered Oct 12 '22 23:10

NoBugs