필터 지우기
필터 지우기

Delete patch in Matlab

조회 수: 14 (최근 30일)
Hrishikesh Das
Hrishikesh Das 2020년 11월 17일
답변: Rik 2020년 11월 17일
I have created a square and patch it in matlab. now I want to make a circular hole in that square patch. How can I do it? Is it possible to delete a small area from a bigger patch?
  댓글 수: 1
Rik
Rik 2020년 11월 17일
As far as I'm aware it is not possible to remove part of a patch, you can create a new patch object that does not include the hole.

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

답변 (1개)

Rik
Rik 2020년 11월 17일
Here is an example of what I wrote in my comment:
t=linspace(0,2*pi,200);
x=sin(t);y=cos(t);
x=[x 0 0 2 2 -2 -2 0 0];
y=[y 1 2 2 -2 -2 2 2 1];
patch(x,y,[0 1 0],'EdgeColor','none')
daspect([1 1 1])
axis([-3 3 -3 3])
if you don't turn the edge off, you will see the seem. If you want to have an edge you can add a second and third patch with no face color and only the edge of the square and the circle.

카테고리

Help CenterFile Exchange에서 Polygons에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by