Appdesigner: Loading values into the standard Matlab Workspace and utilsing them
조회 수: 3 (최근 30일)
이전 댓글 표시
I have a piece of m code that works nicely from Matlab - it loads a long list of parameters into the workspace, performs some calculations and then produces some helpful plots.
But when I try to run the same m code from within Appdesigner, none of my parameters are loaded into the Matlab Workspace, even though the code is unchanged in any way.
Can one of you wonderful people offer any suggestions, please ? Thank you in anticipation of your helpful reply.
댓글 수: 0
채택된 답변
Ameer Hamza
2018년 5월 21일
편집: Ameer Hamza
2018년 5월 21일
If you load the data into the App, it will not appear in the MATLAB base workspace. MATLAB functions or app functions have their own workspaces. So the data loaded inside the function will not be visible in the workspace window unless you are in debugging mode. To correctly load the data and share it in app callback functions you need to do the following.
1) Load the data inside the startUpFcn of the app as shown here. In other words, paste your script inside this function. This function executes everytime you start the app.
2) Then to share the data between app callback functions, refer here. You can create properties, assign the loaded data to these properties in startUpFcn and then other callbacks functions inside your app can access the data using the properties.
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Develop Apps Using App Designer에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!