Load a variable in workspace from a Function
显示 更早的评论
How to load a variable (defined in a sub-function) into the workspace?
采纳的回答
更多回答(1 个)
Paulo Silva
2011-6-5
assignin('base', 'VarNameYouWishAtWorkspace', VarNameAtYourFunction)
2 个评论
Chetan
2011-6-6
Paulo Silva
2011-6-6
We can find all kinds of weird functions inside MATLAB, I used it the first time inside a GUI, there's also the evalin function that you can use for similar purposes, it can even execute code on the workspace (good to define global variables on the workspace).
Global can be applied to any kind of variable but most people will tell you not to use global variables.
类别
在 帮助中心 和 File Exchange 中查找有关 Programming 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!