What is syntax to set second index of listbox to a certain value?

For the first index the syntax is simple:
set(hObject,'String',5); if I want it set it to 5
Also, I know I can set the first and second indexes by doing the following:
set(hObject,'String',{5,5});
How do I just set the second index equal to 5???

 Accepted Answer

a=get(handles.listbox1,'String')
a{2}=5
set(handles.listbox1,'String',a)

More Answers (0)

Categories

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!