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!