How to add two functions as Callback in uicontrol
Show older comments
Hi everyone,
I have a figure opened with two push buttons. While clicking each of the buttons, the value of a certain variable changes.
I would like to make it so the figure also closes once one of the buttons is pressed.
I have tried many variations in order to do this but none work, since I am trying to add 2 functions to the same call back. I know I can create an external function to do this, but it seems redundant.
Is there a simple way to apply this?
Thank you so much!
Accepted Answer
More Answers (1)
Walter Roberson
on 1 Aug 2015
0 votes
It sounds as if you might be using GUIDE. If so use the Property Inspector to edit the Callback property, which will be a string. You can edit the string to close() the figure handle.
Caution: there is a possibility that the Callback might get changed back by GUIDE.
Categories
Find more on App Building in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!