필터 지우기
필터 지우기

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 CenterFile Exchange에서 Migrate GUIDE Apps에 대해 자세히 알아보기

태그

제품


릴리스

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by