Dynamic Option Values in UIDropdown using App Designer

17 ビュー (過去 30 日間)
HM
HM 2018 年 8 月 5 日
回答済み: Chris Portal 2018 年 9 月 2 日
Hi all, I'm just getting into App Designer, and I'm trying to work out how I can create dynamic option values in a uidropdown property. E.g. I want the options available in the DropDown to change, depending on what is going on elsewhere in the code.
I'm using 2017a, and referring to the documentation topics 'uidropdown' and 'DropDown Properties', it seems like it should be possible. The documentation states '(App Designer)' against these topics, so it looks like it is referring specifically to App Designer. However, in App Designer, the section where I would edit this code is greyed out.
Why would the documentation for (App Designer) uidropdown provide so much detail about the syntax and options, if I can't actually edit this within App Designer?
Thanks in advance, Hugh.

回答 (1 件)

Chris Portal
Chris Portal 2018 年 9 月 2 日
You can do this by configuring your dropdown's values in the startup callback function. Right click on the figure background in the drag and drop design canvas, select Callbacks, and choose StartupFcn to add one to your app.

カテゴリ

Help Center および File ExchangeDevelop Apps Using App Designer についてさらに検索

製品


リリース

R2017a

Community Treasure Hunt

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

Start Hunting!

Translated by