How to assign data from App Developer to workspace in Matlab?

98 vues (au cours des 30 derniers jours)
Paul Hinze
Paul Hinze le 10 Mar 2023
Commenté : Cameron le 23 Jan 2025 à 13:02
Dear community,
i am trying to learn the app developer to build a GUI. Until know this works fine, but i do not know how to transfer variables from the GUI to my workspace in Matlab. I tried to use the command assignin, but i did not succeed.
Best,
Paul

Réponse acceptée

Cameron
Cameron le 10 Mar 2023
The way assignin() works to send variables from App Designer to your workspace is that the first arguement is 'base', second is what you want your variable name in your MATLAB workspace to be, and the third is the name of your variable in App Designer. In this case, I called the variable in your workspace 'MyVar' and the data from App Designer as 'app.UIAxes'. Just put whatever your variable is in the place of 'app.UIAxes', and it should show up in your workspace as 'MyVar'.
assignin('base','MyVar',app.UIAxes)
  2 commentaires
Manu
Manu le 23 Jan 2025 à 4:48
Hello Cameron,
How do i send variables/data from workspace to app designer?
Cameron
Cameron le 23 Jan 2025 à 13:02
You would use evalin() to do this. See the documentation for evalin for more.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Develop Apps Using App Designer dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by