필터 지우기
필터 지우기

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

조회 수: 1 (최근 30일)
Tania Goddi
Tania Goddi 2023년 4월 8일
편집: chicken vector 2023년 4월 8일
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?

답변 (2개)

Image Analyst
Image Analyst 2023년 4월 8일

chicken vector
chicken vector 2023년 4월 8일
편집: chicken vector 2023년 4월 8일
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.

카테고리

Help CenterFile Exchange에서 Develop Apps Using App Designer에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by