From: us on
"Maxx " <chatskom(a)chemimage.com> wrote in message <i0ahh2$t43$1(a)fred.mathworks.com>...
> Hello all,
> I cannot figure out how to read data from an Excel sheet into a listbox. The only thing I can find is the 'List Box Tutorial - lbox.m' on the MathWorks website, which works with directories. I'm working with data sets of pharmaceutical components that contain multiple columns of data for each. I can extract the data into a txt array, which is a good start, but I want (I think, unless there's an easier way) to populate a listbox with the pharmaceutical components and, when I click on a particular component, the listbox to update and show the data (other columns of data) for that component. So,
> Question 1: How can I read the txt from the Excel sheet into the list box?
> Question 2: When I select something in the listbox, can I have the listbox show the data for that component?
>
> Thanks
> Maxx

one of the many solutions
- as a skeleton...

[txt,txt]=xlsread('your.xls');
uh=uicontrol('position',[10,10,200,200],'style','listbox');
set(uh,'string',txt);
% now, create a callback for UH, which retrieves the line the user clicks
% and do something with the information...

us