% myflag.m
%  Create a plot of a "flag" of the form:
%
%  *  *  *
%    *  *  *
%  *  *  *
%    *  *  *
% 
%  Four rows, containing 3 stars, staggered.
%
%  We want a blue background rectangle, 6 units wide and 4 units tall.
%
fill ( [ 0.0, 6.0, 6.0, 0.0 ], [ 0.0, 0.0, 4.0, 4.0 ], 'b' );
%
%  Put a star at the center of every (i,j) box for which I+J is odd.
%  The stars should be 1/2 unit in radius, and yellow.
%
hold on
for i = 1 : 4
  for j = 1 : 6
    if ( mod ( i + j, 2 ) == 1 )
      star ( j - 0.5, i - 0.5, 0.50, 'y' );
    end
  end
end
hold off
%
%  Use the same scale in X and Y directions.
%
axis equal
%
%  Don't show the X and Y axis.
%
axis off
%
%  Save a copy.
%
print ( '-djpeg', 'myflag.jpg' );
