Recall Function within Gui

조회 수: 2 (최근 30일)
Tyler Murray
Tyler Murray 2016년 12월 6일
댓글: Tyler Murray 2016년 12월 6일
I designed a gui that allows the user to pick a data file using uigetfile and one of the functionalities is the data is plotted. I would like the user to have the option to plot additional data on the same plot. I added a check box on the gui for the user to indicate they would like to select an additional file to plot, while the checkbox is clicked. All the code within my gui is under a pushbutton callback function. Is there a way to "re-run" the pushbutton callback function (with or without selecting the pushbutton again)? The only thing I need is for the data to keep being plotted on the same graph for as many times the user wants.

답변 (1개)

Walter Roberson
Walter Roberson 2016년 12월 6일
My recommendation in case like that is to put the code to be re-executed into its own function, and then have both callbacks call upon the function.
  댓글 수: 1
Tyler Murray
Tyler Murray 2016년 12월 6일
Can you give me an example using generic pushbutton and checkmark function names? I have been trying a similar approach to what you suggested but can't seem to get it right.

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

카테고리

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