Automatic Callback creation for UI Button
3 views (last 30 days)
Show older comments
Therry Beauge
on 18 Jun 2020
Commented: Therry Beauge
on 24 Jun 2020
Hello there.I have a loop that automatically creates UI buttons based on a file that is read and the amount of instances in the file. I would like to now access those callbacks (or essentially make them) while in the loop. How can I go about this?
I am using MATLAB 202a.
0 Comments
Accepted Answer
Ameer Hamza
on 19 Jun 2020
You can use the ButtonPushedFcn property of the uibutton to assign it a callback. For example
btn = uibuttin();
btn.ButtonPushedFcn = @function_handle_name
5 Comments
Ameer Hamza
on 22 Jun 2020
Can you create a small app which just creates a button and assign a callback function to it, similar to your current app? It will make it easy to see the issue happening in your code.
More Answers (0)
See Also
Categories
Find more on Interactive Control and Callbacks 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!