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,
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