필터 지우기
필터 지우기

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 CenterFile Exchange에서 Develop 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