フィルターのクリア

Appdesigner: Loading values into the standard Matlab Workspace and utilsing them

1 回表示 (過去 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.

採用された回答

Ameer Hamza
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 件)

カテゴリ

Help Center および File ExchangeDevelop Apps Using App Designer についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by