how can i plot multiple circles ?

16 Ansichten (letzte 30 Tage)
ammara khurshid
ammara khurshid am 17 Feb. 2017
Kommentiert: KSSV am 17 Feb. 2017
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')

Akzeptierte Antwort

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

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (1)

Walter Roberson
Walter Roberson am 17 Feb. 2017
radius = 5 * ones(length(p), 1);
viscircles( [p(:), q(:)], radius);
  2 Kommentare
ammara khurshid
ammara khurshid am 17 Feb. 2017
i want circle around each point represented by triangle in the figure
Walter Roberson
Walter Roberson am 17 Feb. 2017
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.

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu 3-D Scene Control finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by