Button push status GUI

2 ビュー (過去 30 日間)
Dominik Maly
Dominik Maly 2019 年 11 月 29 日
回答済み: Navya Seelam 2019 年 12 月 3 日
Hey,
Is there any possibility to change btn1 value or some sort of it's status when it's pushed?
For example:
I've got 2 pushbuttons btn1 and btn2 in my GUI. When I click btn1 the value/flag/status of itself changes autommaticaly to another value(maybe true/1) so i can use it in my code to do some operations.
Is there any option to do it? Except the global values

採用された回答

Navya Seelam
Navya Seelam 2019 年 12 月 3 日
Hi,
You can try this
function pushbutton1_Callback(hObject, eventdata, handles)
% operation 1 here
guidata(hObject, handles);
function pushbutton2_Callback(hObject, eventdata, handles)
% operation 2 here
guidata(hObject, handles);
Operation 1 is performed only on click of pushbutton1 and Operation 2 is performed only on click of pushbutton2

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeInteractive Control and Callbacks についてさらに検索

製品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by