Filter löschen
Filter löschen

How can I use the ButtonGroup in AppDesigner?

9 Ansichten (letzte 30 Tage)
Kim Soltau
Kim Soltau am 7 Mai 2019
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!

Antworten (0)

Kategorien

Mehr zu Develop Apps Using App Designer finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by