Quicky. re 'whos' and workspace.

조회 수: 3 (최근 30일)
Scragmore
Scragmore 2011년 12월 27일
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