Unable to change default radio button in button group

조회 수: 12 (최근 30일)
David K
David K 2021년 9월 27일
댓글: Cris LaPierre 2021년 9월 27일
I am building an app in appdesigner which contains a Radio Button Group. I recently decided to add a new radio button option to the button group and want to set it as the new default value on startup. I did this by copying and pasting an existing button. In the Component Browser the new radio button is listed as a child of the button group in the same list as the old buttons.
The problem I'm encountering is that when I try to select the Value checkbox for the new radio button, it automatically changes it to one of the others. Why would this be happening, and how can I fix it? As far as I can see, all of the properties visible in the Inspector tabs are the same for the old and new buttons.

채택된 답변

Cris LaPierre
Cris LaPierre 2021년 9월 27일
편집: Cris LaPierre 2021년 9월 27일
I discovered that your workflow works for a brand new radio button group. However, once I close the app and reopen it, if I try to add another button, I see the behavior you report. I tested in R2019b, R2020b, and R2021b. This looks like a bug to me. Please report it here.
In the meantime, the workaround might be to recreate your radio button group with all the buttons.
  댓글 수: 2
David K
David K 2021년 9월 27일
Thanks - submitted! FYI, I found an easier workaround to just set the value programmatically in the startupFcn.
Cris LaPierre
Cris LaPierre 2021년 9월 27일
Good idea.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 App Building에 대해 자세히 알아보기

제품


릴리스

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by