how can i plot multiple circles ?

조회 수: 22 (최근 30일)
ammara khurshid
ammara khurshid 2017년 2월 17일
댓글: KSSV 2017년 2월 17일
am trying to plot multiple circles within polygon. i know the center point(vector p and q coordinates of centers) of each circle. am trying the following code but getting only one circle in plot as shown in the figure.
p=[50 68 12 45];
q=[59 90 16 74];
for i=1:length(p)
xunit=xp + p(i)
yunit=yp + q(i)
end
plot(xunit, yunit, 'b')

채택된 답변

KSSV
KSSV 2017년 2월 17일
figure
hold on
for i=1:length(p)
xunit=xp + p(i)
yunit=yp + q(i)
plot(xunit, yunit, 'Ob')
end
  댓글 수: 2
ammara khurshid
ammara khurshid 2017년 2월 17일
thank you
KSSV
KSSV 2017년 2월 17일
You can increase the circle size by specifying marker sizes.

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

추가 답변 (1개)

Walter Roberson
Walter Roberson 2017년 2월 17일
radius = 5 * ones(length(p), 1);
viscircles( [p(:), q(:)], radius);
  댓글 수: 2
ammara khurshid
ammara khurshid 2017년 2월 17일
i want circle around each point represented by triangle in the figure
Walter Roberson
Walter Roberson 2017년 2월 17일
Provided your p and q are the coordinates of the triangles, then my code would do that. You just have to decide what radius you want.

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

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by