필터 지우기
필터 지우기

How do I access and interact with the variables loaded in my App?

조회 수: 31 (최근 30일)
When I run my App, I don’t see a MATLAB interpreter workspace where I can directly interact with the variables loaded in the app. Is there a way to pull those variables in an interactive manner while the app is running (for example, access the string of some static text)?

채택된 답변

MathWorks Support Team
MathWorks Support Team 2019년 3월 1일
MATLAB does not have a separate workspace that stores all of the variables loaded in your app. Rather, there is a base workspace in MATLAB, which contains variables loaded from the command line or created by scripts you run, a global workspace for variables declared as global, and there are unique workspaces for each function, which contain their local variables. Local variables defined in a function workspace will be automatically cleared from memory when the function returns.
Base and Function Workspaces:
Variables created or loaded within the functions of your GUI would be stored in a specific function's workspace, not the base workspace. To view the workspace of a specific function, you can place a breakpoint inside that function before running your app. Then, when you run the app, it will stop when it gets to the breakpoint, and you will be able to see and interact with the variables of that function from the Workspace Browser on the MATLAB Desktop.
You can also use various strategies to share data among different functions of your app, if you do not wish this data to be cleared from memory when a function ends.
Share Data Among Callbacks:

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Migrate GUIDE Apps에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by