Appdesigner: Loading values into the standard Matlab Workspace and utilsing them
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Marco Frieslaar
el 21 de Mayo de 2018
Editada: Ameer Hamza
el 21 de Mayo de 2018
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 comentarios
Respuesta aceptada
Ameer Hamza
el 21 de Mayo de 2018
Editada: Ameer Hamza
el 21 de Mayo de 2018
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 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Develop Apps Using App Designer en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!