How do I call an App created using App Designer with an input argument?
7 views (last 30 days)
Show older comments
MathWorks Support Team
on 7 Dec 2017
Edited: MathWorks Support Team
on 22 Dec 2021
How to make apps created using App Designer accept input arguments, or return outputs?
Accepted Answer
MathWorks Support Team
on 22 Dec 2021
Edited: MathWorks Support Team
on 22 Dec 2021
Starting in R2017b, App Designer supports input arguments for apps. To add input arguments to an app, open the app in App Designer and click Code View. Then click App Input Arguments in the Editor tab.
Refer to the following documentation for more details: https://www.mathworks.com/help/matlab/creating_guis/app-designer-startup-function.html
If you use R2017a or prior releases, try the following workaround:
Create a public function in your app (use the "+ Function" in Code View and choose the "public" option) and use that to pass in any "input variables" after the app is created.
For example:
hApp = myapp;
MySetupFunction(hApp, input1, input2);
0 Comments
More Answers (0)
See Also
Categories
Find more on Startup and Shutdown in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!