Filter löschen
Filter löschen

How to update a new created structure inside GUI

4 Ansichten (letzte 30 Tage)
Christopher Guzman
Christopher Guzman am 16 Okt. 2019
Bearbeitet: Pranjal Kaura am 3 Sep. 2021
I am making a GUI, and would like to create a new structure and be able to use it within the GUI script to add new fields after different events of different components of the GUI.
I have created the structure in the opening function as follows:
patient = struct();
After debugging, I realized the structure would be erased after the opening function. I try different forms of guidata() function to update it, but cannot seem to find an answer.

Antworten (1)

Pranjal Kaura
Pranjal Kaura am 3 Sep. 2021
Bearbeitet: Pranjal Kaura am 3 Sep. 2021
Hey,
You can use the properties functionality in App designer to be able to use variables within your GUI/App script. Declaring a variable 'patient' within the 'startUpFcn' callback, would only make it a local variable (to the 'startUpFcn' function) and thus it would not be visible/accessible to the rest of your code.
You need to set 'patient' as a private/public property of the App, to be able to access it withtin the App. You can learn more about sharing data withtin Apps using the documentation.
Hope this helps!

Kategorien

Mehr zu Migrate GUIDE Apps finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by