Reset button in Matlab GUI
조회 수: 43 (최근 30일)
이전 댓글 표시
Hello
I am working with Mat lab GUI and it works. But I need to add a reset button so that that when the user wants to input other parameters, it clear all the input data and figure of the previous result.
Any idea please how to implement this.
Thank you
Matt
댓글 수: 0
채택된 답변
David Sanchez
2013년 5월 10일
In the reset button callback function just add the code to modify the boxes you need to reset.
set(handles.yourbox1,'string',num2str(0)); ...
once the user inserts the new values in the corresponding boxes, these will overwrite the old ones, if you code works as it should.
추가 답변 (3개)
David Sanchez
2013년 5월 10일
to reset the plot use:
clf
type
help clf
for all the information you'll need
댓글 수: 2
Jonathan
2013년 8월 21일
Hi, I think what you want to do is:
cla(handles.Diagram1,'reset')
If Diagram1 is the tag to the axes object in your gui. I found clf didn't work as expected so changed to cla and upon pushing the reset button in my gui it cleared the figure to be blank.
참고 항목
카테고리
Help Center 및 File Exchange에서 Interactive Control and Callbacks에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!