how can i plot multiple circles ?
17 次查看(过去 30 天)
显示 更早的评论
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')
0 个评论
采纳的回答
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 个评论
更多回答(1 个)
Walter Roberson
2017-2-17
radius = 5 * ones(length(p), 1);
viscircles( [p(:), q(:)], radius);
2 个评论
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 Center 和 File Exchange 中查找有关 3-D Scene Control 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!