pushbutton
显示 更早的评论
Hi,
can you help me?
I have pushbutton and static text. I need: If I press pushbutton, the value in static text should increase with number 1.
Thank you for your help
采纳的回答
更多回答(1 个)
Sean de Wolski
2012-2-14
figure;
ht = uicontrol('units','norm','position',[0.5 0.5 0.1 0.1],'style','text','string','0');
hp = uicontrol('style','push','string','Increment','callback',{@(src,evt,H)set(H,'string',num2str(str2double(get(H,'string'))+1)),ht});
4 个评论
john
2012-2-14
Sean de Wolski
2012-2-14
Okay, so take the engine part of my code and translate it to yours. What I have above does _exactly_ what you asked for.
john
2012-2-14
john
2012-2-14
类别
在 帮助中心 和 File Exchange 中查找有关 Interactive Control and Callbacks 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!