Can I create a drop down menu in App Designer in which the drop down items reference a cell array?
6 ビュー (過去 30 日間)
古いコメントを表示
I have a 20x1 cell array with values that change depending on the array input, and I would like to link this to a drop down menu within App Designer. Is there a way to get the drop down menu to reference an external array for the values, or is a manual Item input the only way to go?
0 件のコメント
採用された回答
Adam Danz
2021 年 3 月 4 日
編集済み: Adam Danz
2021 年 3 月 5 日
The handle to the dropdown menu must be available in the same workspace that updates the cell array. If that's done in AppDesigner, the handle should be in the app class variable. If the cell array is updated outside of app designer, you'll need to pass the dropdown menu handle (or entire app handle) to that function.
Every time the cell is updated, update the Items propery of the uidropdown menu.
An alternative and less efficient method would be to define the cell array as an app property and use a timer object to iteratively check if the cell array has changed and to update the Items list.
2 件のコメント
Adam Danz
2021 年 3 月 5 日
Why not set the dropdown menu directly from the source that produces the cell array? That would avoid writing/reading to file and the need to press the push button to update the menu.
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Migrate GUIDE Apps についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!