Mostrar comentarios más antiguos
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
Respuesta aceptada
Más respuestas (1)
Sean de Wolski
el 14 de Feb. de 2012
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 comentarios
john
el 14 de Feb. de 2012
Sean de Wolski
el 14 de Feb. de 2012
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
el 14 de Feb. de 2012
john
el 14 de Feb. de 2012
Categorías
Más información sobre Interactive Control and Callbacks en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!