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