Matlab App Designer ListBox.Value changes when ItemsData is an array
Show older comments
Hi All,
I am having a problem with app designer LisxtBox. I have a ListBox and I define the names of my items in a cell array (for example; ch1, ch2, ch3, ch4). When I use the following commands, I can retrieve the selected item or its index
app.ListBox.Value
[~,index] = ismember(app.ListBox.Value,app.ListBox.Items)
However, when I attribute (match) the items with an array (for example; ch1 becomes Nx1, N being the number of data points. I use app.ListBox.ItemsData for defining each items data array), automatically 'app.ListBox.Value' becomes 'Nx1' cell array.
My intention is only be able to retrive the name of the item I selected (when I click on listbox item, I only want to see ch1, ch2 etc., not Nx1 array). Should I use something else rather than 'ListBox.Value'? Can you please help me with that?
Thank you.
Accepted Answer
More Answers (0)
Categories
Find more on Matrix Indexing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!