Filter löschen
Filter löschen

Reload a UIControl's value from .fig file

3 Ansichten (letzte 30 Tage)
David Wasserman
David Wasserman am 13 Mai 2020
Beantwortet: Rik am 13 Mai 2020
My GUI has an edit control. When the GUI starts, the edit control shows the text specified as the 'String' property in the .fig file, which is '.6'. Later, the text may get changed. Can I put a statement in a callback function that will cause the GUI to reload this text from the .fig file? I don't want to use
set(hObject, 'String', '.6')
because the property may later get changed in the .fig file.

Antworten (1)

Rik
Rik am 13 Mai 2020
Why use a fig file to store data? You shouldn't be storing data in a fig file, just as you shouldn't be storing code in a mat file.
If you want a reset funcitonality you will have to make that yourself by storing the initial values during the startup.
I would encourange you to read this thread. You will also find an example of how to implement this in a class. How to implement it in a GUIDE-created GUI is a bit more tricky, as you'll have to hard-code which objects and parameters to store.

Kategorien

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

Produkte


Version

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by