Items + Items Data issue
조회 수: 11 (최근 30일)
이전 댓글 표시
I have defined:
app.select_solver_calc_properties.Items = {'Fminsearch', 'Fmincon', 'Look-up Table', 'Genetic Algorithm'};
app.select_solver_calc_properties.ItemsData = {'[1 2 3 4]'};
When I run
app.select_solver_calc_properties.Value = 3;
I get the error:
'Value' must be an element defined in the 'ItemsData' property.
EDIT: The issue is that the inspector defaults to a non-numeric type for ItemsData. I'm not sure how to fix this since I can't edit the component setup part in App Designer.
댓글 수: 0
채택된 답변
Ameer Hamza
2020년 5월 13일
You are using char array to set the UserData property. You should just pass it a numeric array
app.select_solver_calc_properties.ItemsData = [1 2 3 4];
댓글 수: 4
Ameer Hamza
2020년 5월 14일
I am glad to be of help.
Hopefully, they will make it possible to specify a numeric array directly from the inspector panel.
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File 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!