listbox items to array
- From: "GUIBuilder " <ericjaycorbett@xxxxxxxxx>
- Date: Wed, 22 Jun 2011 22:42:05 +0000 (UTC)
Hello everyone,
I am trying to get the currently selected items in a listbox into array. The end goal is to then write that array to an excel file (using xlswrite I suppose).
This is what I have so far. This code populates the listbox from an excel sheet and allows it to be updated:
function listbox1_CreateFcn(hObject, eventdata, handles)
[substance,substance]=xlsread('C:\Users\ecorbett\Documents\VCoachData\Labels\RHA.xlsx','Sheet1','A1:A10000');
set(hObject,'string',substance); if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
end %function listbox1_CreateFcn()
function pushbutton1_Callback(hObject, eventdata, handles)
[substance,substance]=xlsread('C:\Users\ecorbett\Documents\VCoachData\Labels\RHA.xlsx','Sheet1','A1:A10000');
set(handles.listbox1,'string',substance);
msgbox('The listbox has been updated.','Update Complete','help');
end
function pushbutton2_Callback(hObject, eventdata, handles)
%take the currently selected items in the listbox and store them into an array.. somehow%
end
another question I guess is do I need to use an array? I was under the impression that the items in a listbox are already a cell array?
.
- Prev by Date: Creating an anonymous function in real time
- Next by Date: Re: MODWT
- Previous by thread: Creating an anonymous function in real time
- Next by thread: Re: DCC GARCH - UCSD Garch tool box
- Index(es):
Relevant Pages
|