push button to change a variable
이전 댓글 표시
I guesss this is a very simple question, but I am spending more time searching for the answer, so I better ask here instead.
I made 3 pushbuttons, when I click on of them, a variable has to be changed, so like:
[Button1] when pressed: bp = sys
[Button2] when pressed: bp = mean
[Button3] when pressed: bp = dia
Thanks in advance
채택된 답변
추가 답변 (1개)
bimal raj
2012년 1월 31일
sorry i didnt see your comment
In this code kiessys = uicontrol( 'Position', [10 35 60 30],'String','Sys®','Callback','????' );
you are not setting the style property..
you can try this
h1=uicontrol('Style','text','position',[a b c d],'tag','text1','String','Sven');
push buttons may be created like this
h2= uicontrol('Style','pushbutton','String','Sys(R)','callback','pb1_callback','position',[a b c d]);
in the call back function 'pb1_callbck' add this code
set(findobj('tag','text1'),'String','bp=mean');
similarly you can create other push buttons and write the call back functions.
uicontrol handles also can be used for changing properties. matlab help contains many example programs
카테고리
도움말 센터 및 File Exchange에서 Programming에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!