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!