App Designer - Button group
이전 댓글 표시
Hello, I am working on a GUI using two buttons where the enhancement operations perfromed on an image can be changed. Once I select the required operation; I have an another drop down gives options in relation to the first selection. My questions is
- It looks like by default the first button is always pressed. So when am running if condition to check whether the first button is selected or not; some how the code within the if not executing; it is only executing when the value is changed (means when option changed from one radio button to the other and vice versa)
How can i access the initial value or default value of radio button selection.
Thanks.
답변 (2개)
Cris LaPierre
2020년 9월 17일
0 개 추천
댓글 수: 8
Venkata Khambhammettu
2020년 9월 17일
편집: Venkata Khambhammettu
2020년 9월 17일
Cris LaPierre
2020년 9월 17일
It would be easier to help if you shared the mlapp file.
Venkata Khambhammettu
2020년 9월 17일
Cris LaPierre
2020년 9월 17일
For you, it looks like the default is to have no button selected. This would cause your if statement to evaluate as false, and therefore the code inside it to not be executed.
if app.LinearStretchingButton.Value
Note that your dropdown is also unselected by default, so those if statements will also not execute.
if strcmp(dropdown_value,'Low') % also check 'Medium' and 'High'

Venkata Khambhammettu
2020년 9월 18일
Cris LaPierre
2020년 9월 18일
편집: Cris LaPierre
2020년 9월 18일
That was my point. Linear stretching is NOT selected by default. If you look at the screen shot, the radio buttons are both unselected.
Venkata Khambhammettu
2020년 9월 18일
Cris LaPierre
2020년 9월 22일
편집: Cris LaPierre
2020년 9월 22일
What is your trigger? Do you want the app to open with the linear stretching result already displayed? If so, place the following at the bottom of your startupFcn callback.
MethodButtonGroupSelectionChanged(app, app.MethodButtonGroup)
Mario Malic
2020년 9월 22일
편집: Mario Malic
2020년 9월 22일
0 개 추천
- Create property that takes Method and Contrast level values.
- Create a callback for button group (method and image enhancement operation) - see this property (app.ImageEnhancementOperationButtonGroup.SelectedObject.Text)
- Create a callback that sends contrast dropdown value to property.
- Initialise starting values in startupFcn, for each component.
You read your image twice, save it in a property.
카테고리
도움말 센터 및 File Exchange에서 Contrast Adjustment에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
