From: Matt Fig on
Apparently handles.listbox1 is not defined. Also, you should index D with {}. Also, you could just concatenate the cell arrays instead of looping like that.
From: ImageAnalyst on
And the reason listbox1 is not defined (yet) is because you put your
code in the "create" callback rather than the "click" callback. The
listbox is in the process of being created and so it doesn't fully
exist yet. Move your code to the regular click callback and make the
other fixes Matt noted and you should be fine.