I can draw square using four points. I am drawing a suqare at one point as origin and a side 1 as below.
L = 1 ; % length of the square
% Form vertices of the square
A = [0 0] ;
B = [1 0] ;
C = [1 1] ;
D = [0 1] ;
P = [A ; B; C; D ;A] ;
plot(P(:,1),P(:,2))
You can extend the above example to your case.

