List Box in GUI
显示 更早的评论
How to get the index of elements from the list box of not selected items from list box.
Usually list box gives elements index of selected items using property values
采纳的回答
更多回答(1 个)
Titus Edelhofer
2012-3-30
Hi,
you could do the following if I understood the question correclty:
allStrings = get(handles.listbox1, 'string');
selected = get(handles.listbox1, 'value');
% all indices:
allIndices = 1:length(allStrings);
% now subtract:
unselected = setdiff(allIndices, selected);
Titus Titus
类别
在 帮助中心 和 File Exchange 中查找有关 Matrix Indexing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!