Quicky. re 'whos' and workspace.

1 次查看(过去 30 天)
Hi,
What is the location/path of the workspace or how do I 'whos' my workspace from within a function.
If I from within a function...
x = whos;
I get a list of variables/arrays declared within function.
x = whos('global');
I get variables/arrays declared globally.
What I want is same result as if I ran 'whos' from the command prompt, ie my workspace
>>x = whos;
Thanks, happy holiday, Christmas or drinking.
Regards,
AD

采纳的回答

Fangjun Jiang
Fangjun Jiang 2011-12-27
x=evalin('base','whos')

更多回答(2 个)

Honglei Chen
Honglei Chen 2011-12-27
You could try evalin
doc evalin

Daniel Shub
Daniel Shub 2011-12-28
I am not sure why you want to do whos in the base or caller workspace, but my guess is that you might want something like
doc inputname

类别

Help CenterFile Exchange 中查找有关 MATLAB 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by