Is this (small) capacity correct? If it is, too bad...
No, a listbox can carry more than 27 strings. Just try it:
C = cell(1, 32);
for iC = 1:32
C{iC} = sprintf('line %d', iC);
end
uicontrol('style', 'listbox', 'string', C);
Therefore I conclude, that another mistake causes, that you see too few strings.
Jan
> Does anyone now if there is a limitation in the number of strings a
> listbox can hold?
Not off-hand, but somewhere over 1500, as I have used that much before.
> > Does anyone now if there is a limitation in the number of strings a
> > listbox can hold?
>
> Not off-hand, but somewhere over 1500, as I have used that much before.
It works well with 40.000 strings also. A problem is just the speed:
In Matlab 6.5 using a single string with | as separator is remarkably faster:
| method: 3.9 sec, cell string: 23.4 sec
In Matlab 2009a the | method is nearly unusable for large strings, while a cell string is obviously implemented with care:
| method: 63.3 sec, cell string 0.4 sec
BTW: Creating a |-separated string was very slow with SPRINTF. CStr2String (published in the FEX) is 40 times faster for 40.000 strings.
So, Kyung, where ist the problem?
Kind regards, Jan