MATLAB: How to delete polyline from Drawpolyline matlab function

how to delete polyline from drawpolyline matlab functionMATLAB

I have list of polyline drawn using drawpolyline matlab function.
the list contains nearly 500 polylines , now if i want to delete 10th polyline from the 500 polylline , how can i do it ?
Further , after deleting now the list should reduce to 499 polyline, can anyone help me please ?

Best Answer

I have resolved this issue.
In drawpolyline function, we have a UserData attributes , so i use this UserData attribute to allocate each polyline with specific ID. further adding additional right click option by using "uimenu" for each polyline drawn, this option will have user define function
when this click uimenu option is selected, then collect all the attributes of the select polyline.
Now we can delete the selected polyline from the list of 500 polylline and update the table of polyline accordingly.
Related Question