Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

https://www.mathworks.com/matlabcentral/answers/376091-index-of-the-items-in-a-listbox

listitems = {'data1', 'data2', 'vector1', 'vector2', 'vector3', 'emc'};
hfig = uifigure;
hbox = uilistbox(hfig, 'Items', listitems, 'Multiselect', 'on');
hbox.Value = {'data1', 'vector1', 'vector2', 'emc'};  %simulate user selection

%get index of selected values
[~, index] = ismember(hbox.Value, hbox.Items)

  • No labels

0 Comments

You are not logged in. Any changes you make will be marked as anonymous. You may want to Log In if you already have an account.