Creating a reset button in GUI

조회 수: 1 (최근 30일)
Jared
Jared 2011년 11월 1일
I'm trying to create a reset button in my GUI. Is there any command to make everything go back to it's default state?
Currently I'm using the set (46 lines) command to set the value to 0 for all toggle buttons and check boxes, and to set the string in all edit boxes.
Also, I'm trying to close all figures, but close all closes the gui as well. I could use the individual handle and close them 1 line of code at a time, but it is variable which ones will be open.

채택된 답변

Fangjun Jiang
Fangjun Jiang 2011년 11월 1일
Use findobj() to find the handles of all the toggle buttons, or check boxes, then you can use set() to set their values to be 0 in one line.
Do the same to figures. Remember most of MATLAB functions such as set(), close() support vector or matrix inputs.
  댓글 수: 1
Walter Roberson
Walter Roberson 2011년 11월 2일
And to be explicit: No, there is no command to make the GUI elements go back to their default state.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Interactive Control and Callbacks에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by