绘制多个圆圈

时间:2016-08-14 14:10:55

标签: matlab plot geometry figure centroid

我想绘制多个圆圈,中心已经确定了以前的质心。

所以我有这个代码使用质心作为圆的中心,但我得到错误:“使用+ Matrix尺寸的错误必须同意。”

r = 4;
cen_x = centroid(:,1);
cen_y = centroid(:,2);
th = 0:pi/50:2*pi;
xunit = r * cos(th) + cen_x;
yunit = r * sin(th) + cen_y;
hold on
h = plot(xunit, yunit);

任何帮助?

1 个答案:

答案 0 :(得分:0)

您正尝试将@Configuration @EnableAspectJAutoProxy @Import(MetricsConfiguration.class) @PropertySource("classpath:application.properties") public class ApplicationConfiguration { } cos(th)添加到一起,并且它们的尺寸不匹配。您需要使用cen_x才能正确广播尺寸。

bsxfun

您也可以使用xunit = bsxfun(@plus, cen_x, r * cos(th)).'; yunit = bsxfun(@plus, cen_y, r * sin(th)).'; plot(xunit, yunit) 为您绘制圆圈。您还可以指定rectangle来填充它们。

FaceColor