0

I am trying to plot a point, a circle surrounding a point with a given radius and polygons from array of coods as input. I have the following code implemented

    plot(start(1),start(2))
    axis([0,256,0,256]);
    hold on;
    %pdecirc(endp(1),endp(2),10);
    for i = 1:size(X,1)
           patch(X(i),Y(i),'r');
    end

However, pdecirc is not working. it opens a new editor and thus I have commented it. X and Y are 2d arrays of dimensions (no.of points X 4). Thus X(i) has 4 X values and Y(i) has 4 X values. This code is not drawing the polygons as expected. Can you please tell me the best way of achieving what am trying to do? A code would be really helpful. Thanks in advance.

4

1 に答える 1

1

pdecirc は、一般的な円の描画用ではなく、matlab pde ツールキットの一部であるようです。

r     = 10;
theta = linspace(0, 2 * pi, 100);
x     = r * cos(theta);
y     = r * sin(theta);
plot(x, y);

パッチコマンドは機能しますか?

于 2013-09-29T05:29:01.407 に答える