Plotting Selected Items from a List
显示 更早的评论
I have been trying to figure out how I can plot one or more items that the user chooses from a list. I have 22 items in total that each have their own specific plots. Is there any way I can do this? So far, I have used listdlg() and if-else statements, but that only works if I only want to plot one item.
6 个评论
Geoff Hayes
2019-6-5
autumn - please post some of your code so that we can get an idea of what you have attempted. How do you plot the list items? Do you allow for multi-selection of list items?
autumn
2019-6-5
Geoff Hayes
2019-6-5
How are you getting the coordinates from the items that have been selected? Presumably objects is an array of indices. Also, please clarify what you mean by when I try to allow for selection of more than one object, it no longer works. What happens? Is there an error or something else?
autumn
2019-6-5
Star Strider
2019-6-5
Consider using the any function:
any(objects == 1)
Geoff Hayes
2019-6-5
Since objects is a 1x2, does that mean you have selected the first and eigth item in the list box? How are you then extracting the coordinates from the structure? Please show the code to do this.
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Creating, Deleting, and Querying Graphics Objects 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!