| MATLAB Function Reference | ![]() |
List variables in the workspace
Graphical Interface
As an alternative to whos, use the Workspace browser.
Syntax
who whos who('global') whos('global') who('-file','filename') whos('-file','filename') who('var1','var2',...) whos('var1','var2',...) who('-file','filename','var1','var2',...) s = who(...) s = whos(...) who -file filename var1 var2 ... whos -file filename var1 var2 ...
Description
who
lists the variables currently in the workspace.
whos
lists the current variables and their sizes and types. It also reports the totals for sizes.
who(' list the variables in the global workspace.global') and whos('global')
who(' list the variables in the specified MAT-file -file','filename') and whos('-file','filename')
filename. Use the full path for filename.
who('var1','var2',...) and whos('var1','var2',...)
restrict the display to the variables specified. The wildcard character * can be used to display variables that match a pattern. For example, who('A*') finds all variables in the current workspace that start with A.
who(' list the specified variables in the MAT-file -file','filename','var1','var2',...) and
whos('-file','filename','var1','var2',...)
filename. The wildcard character * can be used to display variables that match a pattern.
s = who(...)
returns a cell array containing the names of the variables in the workspace or file and assigns it to the variable s.
s = whos(...)
returns a structure with these fields
namevariable namesizevariable sizebytesnumber of bytes allocated for the arrayclassclass of variable
and assigns it to the variable s.
who are the unquoted forms of the syntax.-file filename var1 var2 ... and whos -file filename var1 var2
...
See Also
assignin, dir, evalin, exist, what, workspace
| whitebg | wilkinson | ![]() |