Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 1

• List Box

– When the list box Callback is triggered, the list box Value property contains the index
of the selected item, where 1 corresponds to the first item in the list. The String
property contains the list as a cell array of strings.

– This example retrieves the selected string. It assumes listbox1 is the value of the Tag
property. Note that it is necessary to convert the value returned from the String
property from a cell array to a string.

function listbox1_Callback(hObject, eventdata, handles)

index_selected = get(hObject,'Value');

You might also like