How to Set App Designer Drop Down and List Box Data types

조회 수: 15 (최근 30일)
M G
M G 2018년 5월 16일
답변: Chris Portal 2018년 5월 20일
I've started a new question, as I am experiencing the same difficulty with Drop Down menus in App Designer. A previous answer suggested that I consult https://www.mathworks.com/help/matlab/ref/uilistbox.html#bui0qid, and so I did that. The referenced URL displays some code that is generated _ programmatically_ for UIFigures, even though the title of the URL page suggests that the process is the same for App Designer.
However, when I try to insert or edit any extra lines of code into script that is generated by App Designer [in the UIFigure "function createComponents(app)"], that is simply not allowed.
It does seem to me that the _ * only*_ way to make changes to any of the List Box Properties in App Designer is via the LIST BOX PROPERTIES dialog panel.
I have hacked at this for awhile now and I have included an attachment with markups and some comments. It is easy to see that in the first panel, the ItemsData is in the format * [0,25,40,100]* and this is recognized by the code as numerical.
If one enters the numerical Data you wish to associate with the Items simply as numbers within the App Designer dialog box, they appear in the code as ={'1', '2', '3', '4'}, and are treated as CHARACTERS.
If one instead enters the numerical Data you wish to associate with the Items as a string of numbers enclosed within square brackets =[ ...] via the App Designer LIST BOX PROPERTIES dialog box, both the square brackets _ and_ the data that they contain are all treated as CHARACTERS.
Given that you cannot edit the Code generated by App Designer, and are confined to using the LIST BOX PROPERTIES dialog box, only, _ How do you force App Designer to treat the values entered there as double-precision Numerical (Scalar) quantities?_

채택된 답변

Chris Portal
Chris Portal 2018년 5월 20일
See the answer thread for the following post on how to address this:

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Develop Apps Using App Designer에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by