How to remove rectangle from plot after updating

조회 수: 3 (최근 30일)
Jason Hawkins
Jason Hawkins 2015년 10월 4일
댓글: KSSV 2018년 9월 5일
I am plotting a series of randomly placed rectangle objects. Rectangles are not allowed to overlap. I have a method for removing rectangles when they overlap another rectangle, but the removed rectangle object is still plotted. How can I tell Matlab to only plot the final set of rectangles?
I can remove the object from the class I created, but it still appears in the plot.
  댓글 수: 2
Jason Hawkins
Jason Hawkins 2015년 10월 4일
편집: mizuki 2018년 9월 5일
I believe I have it working now. I needed to refer to the rectangle property of the object when I called delete() on it rather than the whole object.
Ex. delete(obj) - does not work
delete(obj.rectangle) - does work
KSSV
KSSV 2018년 9월 5일
You will get exact help on knowing the code.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by