Plotting Selected Items from a List
Mostra commenti meno recenti
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 Commenti
Geoff Hayes
il 5 Giu 2019
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
il 5 Giu 2019
Geoff Hayes
il 5 Giu 2019
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
il 5 Giu 2019
Star Strider
il 5 Giu 2019
Consider using the any function:
any(objects == 1)
Geoff Hayes
il 5 Giu 2019
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.
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Creating, Deleting, and Querying Graphics Objects in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!