MATLAB Answers

0

Recall Function within Gui

Asked by Tyler Murray on 6 Dec 2016
Latest activity Commented on by Tyler Murray on 6 Dec 2016
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.

  0 Comments

Sign in to comment.

1 Answer

Answer by Walter Roberson
on 6 Dec 2016

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 Comment

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.

Sign in to comment.