Borrar filtros
Borrar filtros

How can I use the ButtonGroup in AppDesigner?

9 visualizaciones (últimos 30 días)
Kim Soltau
Kim Soltau el 7 de Mayo de 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!

Respuestas (0)

Categorías

Más información sobre Develop Apps Using App Designer en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by