I have a problem with appdesigner, can you help me?

1 view (last 30 days)
Hello everyone.
I have a problem with appdesigner.
I have created two GUI, in the first GUI random images are displayed in time, the latter is taken from input, in the second GUI a questionnaire is made, I would like to send the data of this questionnaire to the first gui. But I can't, can you help me?

Answers (2)

Image Analyst
Image Analyst on 8 Apr 2023

chicken vector
chicken vector on 8 Apr 2023
Edited: chicken vector on 8 Apr 2023
I must say that is really hard to help you with so little infromation.
If you don't need real time sharing you can pass the data with save and load using .mat files.
Otherwise, if you need real time sharing, AppDesigner is not so beginner-friendly.
To share data between two different .mlapp files you have to use properties.
If App1 is the main window, you can create a property in it that works as instance handle of App2.
For example, in the initialising function createComponents you can define the property
app1.app2Handle = App2;
Please see the demo here and rememeber the inlcude app2Handle in the class properties.
Using property allow to have save in the first app class the isntance of the second app, granting permanent acces to its data and features. If you need the data only once you don't have to use properties,
What I like to do instead, is do develop the multi-GUI app in one code. You can create as many instances of UIFigure as you want inside the class instance app (app.UIFigure, app.UIFigure1, ...) and manage their existance and visibility with events. With this approach I usually build the GUI in AppDesigner and copy-paste everything for the Code view in a script to do the programmin part, to have more freedom and avoid greyed out code. You can find an example here.

Categories

Find more on Develop Apps Using App Designer 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!