App Designer Radio Button

조회 수: 1 (최근 30일)
Jonathan Moorman
Jonathan Moorman 2020년 6월 23일
댓글: Ashish Azad 2020년 6월 23일
Hi! I currently have a problem with a radio button I am using for app designer. The purpose of my radio button is to select one of these three equations to be calculated based on what the user needs. The problem occurs when the app is closed then reopened, the "Linear" button is automatically selected; however, the code does not count this as actually selecting the linear button, and it will perform the calculations based on what button was selected just before the app was closed. So if you want to use the linear button on startup, you have to unselect it then selected it again. Not very user friendly. Any way to fix this? Thanks
Here is my code that controls the radio button then calculates the notch response based on the selection.
if Y == 1
NotchResponse = (app.EquationsSlopeEditField.Value).*(Depth)+ app.EquationsYInterceptEditField.Value;
elseif Y == 2
NotchResponse = (app.EquationsSlopeEditField.Value).*(log(Depth))+ app.EquationsYInterceptEditField.Value;
elseif Y == 3
NotchResponse = (app.EquationsSlopeEditField.Value).*((Depth).^(app.ExponentEditField.Value));
end

채택된 답변

Ashish Azad
Ashish Azad 2020년 6월 23일
Hi Jonathan,
A simple solution to this problem is to select the Linear button in the startup function
If you are not able to find startup function then you can add it from callbacks.
I highly encourage you to use startup function for the initialization of everything, so the app starts without any glitches.
Let me know if this helped you
  댓글 수: 2
Jonathan Moorman
Jonathan Moorman 2020년 6월 23일
That worked great! It also helped me fixed more than just one problem. Thanks
Ashish Azad
Ashish Azad 2020년 6월 23일
I am glad that it helped you, thanks for the appreciation

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by