Connecting final and initial point in simple x-y plot (Plotting closed curve/polygon)

后端 未结 3 728
情歌与酒
情歌与酒 2021-01-12 20:39

Say, for example, I had ...

x = [1 1 2 2];
y = [1 2 2 1];
plot(x, y, \'b-\');

I will get a plot with lines connecting the points (1,1), (1,

3条回答
  •  终归单人心
    2021-01-12 20:49

    Do you have the Image Processing Toolbox? If yes,

     impoly(hparent, position, 'Closed')
    

    might be of use to you.

    http://www.mathworks.de/help/toolbox/images/ref/impoly.html

提交回复
热议问题