If the four (x,y) points are vectors P1, P2, P3, and P4,
plot([P1(1),P2(1),P3(1),P4(1),P1(1)],[P1(2),P2(2),P3(2),P4(2),P1(2),’y-‘)
will draw the corresponding rectangle (provided the points are in the proper perimeter order.)
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!