Problem with listbox in Matlab GUI.
古いコメントを表示
Warning: single-selection listbox control requires that Value be an integer within String range Control will not be rendered until all of its parameter values are valid
I have 2 listbox. First listbox is show X coordinates and second one show the correspondind Y values for each X. eg. When I press X = 100 on the second listbox I see e.g Y = 100,101,102 ect. Sometimes when I press some values on Y listbox, and after that I change value on X listbox the Y listbox disappear and the error above shows.
Picture shows how it should work

Picture shows how it work when I press value higher than 100 on Y then when I press 442 X the Y listbox disappear.

I didn'y show the code because it's a lot of code and I think it's something wrong with listbox by itself. This is working properly. When I press 442 X it's working well but the error happens under specific conditions.
Any idea what might go wrong ?
採用された回答
その他の回答 (3 件)
Jan
2013 年 9 月 27 日
The warning message is clear: The values of the 'Min' and 'Max' properties define the listbox as a single selection control. Then exactly one element must be selected. If you want to select no or multiple elements, the distance between 'Min' and 'Max' must be greater than 1. Exmaple:
h = uicontrol('Style', 'listbox', 'String', {'1', '2'}); % Ok
pause(1);
set(h, 'Value', []); % Nothing selected, warning appears
pause(1)
set(h, 'Max', 2); % Listbox appears again
Jonasz
2013 年 9 月 28 日
カテゴリ
ヘルプ センター および File Exchange で Language Support についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


