MATLAB Answers

How to use data from base workspace in app designer application

191 views (last 30 days)
Daan Decleer
Daan Decleer on 1 May 2017
Commented: Adam Danz on 8 Feb 2020
Hello
In my app designer program I have several Numeric Edit Fields, I would like to set them to the already declared variables before in the base workspace when my application opens.
Is there a way I can load the existing Variable and put them in the already existing EditField?
Thanks already, I look out to your answers.

  0 Comments

Sign in to comment.

Accepted Answer

xi
xi on 1 May 2017
initialize your EditFields using evalin(), such as: app.EditField1.Value=evalin('base','myvar1'); app.EditField2.Value=evalin('base','myvar2'); ...

  3 Comments

Daan Decleer
Daan Decleer on 2 May 2017
Thanks for your answer Xi!
Can you solve the DropDowns in the same way? If I initialize the DropDown with a String (which is one of it's possibilitys) will it work?
Best Regards
xi
xi on 2 May 2017
For example, if you have mystring={'A','B','C'}; in the workspace,
you can set the DropDown.Items in the startup function of app.
S=evalin('base','mystring');
app.DropDown.Items=S;
Adam Danz
Adam Danz on 8 Feb 2020
Check out this demo that shows how to produce a UITable that lists all variables in the workspace, their size, and class, and allows the user to use a checkbox to select which variables should be loaded into the app.
200208 171846-.png

Sign in to comment.

More Answers (0)


Translated by