Help to use Callback property in uicontrol
Show older comments
Hi,
I don't understand how works the 'Callback' property in uicontrol. For example, I create a pushbutton as
pb = uicontrol('Style', 'pushbutton', 'Callback', @fun);
as callback function I need simply an increment of a variable "i" initially i=0; in other words when I click in the pushbutton it should cause increment of "i" by one.
I tried with:
function fun(in)
in=in+1;
end
and so...
pb = uicontrol('Style', 'pushbutton', 'Callback', {@fun, i});
but it doesn't work. Some suggestions ?
Thanks
Accepted Answer
More Answers (0)
Categories
Find more on Interactive Control and Callbacks in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!