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!