フィルターのクリア

How can I use the ButtonGroup in AppDesigner?

9 ビュー (過去 30 日間)
Kim Soltau
Kim Soltau 2019 年 5 月 7 日
Hello,
I haven't been working with the App Designer for very long and I currently have a proble. The point is that I want to create a ButtonGroup with 2 buttons. I created the callback function "ButtonGroupSelectionChanged", which creates "selectedButton = app.ButtonGroup.SelectedObject" for me. Now I would like to execute an action if button 1 is confirmed and execute a function if button 2 is confirmed.
How can I query this in the code? I am not sure what is in the variable selectedButton.
With a SwitchButton I solved it as follows (The two positions are called "active" and "inactive").
if strcmp(status, 'inactive')
app.Lamp_LEDoff.Color = 'red';
writeDigitalPin(app.a, 'D11',0);
elseif strcmp(status, 'active')
app.Lamp_LEDoff.Color = 'green';
end
Unfortunately, this does not work with a button.
It would be great if someone could help me!

回答 (0 件)

カテゴリ

Help Center および File ExchangeDevelop Apps Using App Designer についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by