フィルターのクリア

Reload a UIControl's value from .fig file

3 ビュー (過去 30 日間)
David Wasserman
David Wasserman 2020 年 5 月 13 日
回答済み: Rik 2020 年 5 月 13 日
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.

回答 (1 件)

Rik
Rik 2020 年 5 月 13 日
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.

カテゴリ

Help Center および File ExchangeMigrate GUIDE Apps についてさらに検索

タグ

製品


リリース

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by