Hi,
This is actually the expected behavior of the "poly2cw" function. This function expects its input to be a counter clockwise ordered polygon and simply reorders the vertices bottom to top to change the ordering to clockwise.
If you wish to plot points in the clockwise direction, I would suggest using the "convhull" function before the "poly2cw" function. The "convhull" function converts the unordered set of points to counter-clockwise ordered points. You may then use the "poly2cw" to convert them to clockwise order. Here is an example demonstrating this:
K = convhull(x1,y1);
ccx = x1(K);
ccy = y1(K);
[cx,cy] = poly2cw(ccx,ccy);
Documentation for the "convhull" function can be found here:
Hope this helps!
-Veda