it is possible to access the 'base' workspace from a subfonction ?

6 次查看(过去 30 天)
I'm would like to access some variables in the 'base' workspace from a subfonction. because when I tried the variables is not found.
thanks in advance ;)

采纳的回答

Daniel Shub
Daniel Shub 2012-7-17
Yes if is possible to manipulate and access the base workspace from within a function. Just because MATLAB provides this functionality, however, doesn't mean it is a good idea to use it. Please consider alternatives.
The functions you are looking for are EVALIN and ASSIGNIN.

更多回答(1 个)

khaled DAWOUD
khaled DAWOUD 2012-7-17
you can use assignin function to reference to variable in the workspace in your function.

类别

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

Community Treasure Hunt

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

Start Hunting!

Translated by