No BSD License  

Highlights from
MATLAB for Engineers

from MATLAB for Engineers by Adrian Biran
Companion Software

fig05_08.m
%FIG05_08 Figure 5.8, A square.

P1 = [ -0.5; 0; 1 ]; P2 = [ -0.5; 1; 1 ];
P3 = [  0.5; 1; 1 ]; P4 = [  0.5; 0; 1 ];
square = [ P1 P2 P3 P4 P1 ];
plot(square(1, :), square(2, :))
axis([ -4 4 -1 7 ]), axis('square')
title('Figure 5.8, A square')
xlabel('x'), ylabel('y')

Contact us at files@mathworks.com