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!