필터 지우기
필터 지우기

AppDesigner : How to Change the value of a dd according to the user input to another dd?

조회 수: 1 (최근 30일)
I am trying to build a GUI, one of the functionalities needed is when a user change a value in one dropdown list, I want another dropdown list to change to a certain value at the same time: if user chooses Option 2 from dd 1 then dd 2 should show Option 3. Please note both dd have same Items (dd1 has option 1. option2, option 3 and dd 2 has same items), this function should not tweak or change any of the dd items. Any ideas on how to do so? What to replace the "???" with in the following: (I know switch/case might work instead of the if-else)
function Changedd2whenddchanges(app)
value = app.DropDown.Value
if value == ('Option 2')
app.DropDown2.???== ('Option 3')
end
end
Thank you :)
  댓글 수: 5
Adam
Adam 2018년 3월 9일
Are you sure you didn't get it wrong and use the == that you have included in your code above instead of = ?
kmoust Taf
kmoust Taf 2018년 3월 9일
After troubleshooting the problem was not in the function, there was no error when running, turned out in appdesigner I have to create the function, and then create a callback function in which I can call the function.

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

답변 (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