function C = checkerboard ( n )

%*****************************************************************************80
%
%% checkerboard() returns a matrix of zeros and ones.
%
%  Discussion:
%
%    checkerboard(n) is an n-by-n matrix.
%
%  Licensing:
%
%    Copyright 2014 The MathWorks, Inc.
%
%  Author:
%
%    Cleve Moler
%
%  Reference:
%
%    Cleve Moler,
%    Experiments with MATLAB
%    https://www.mathworks.com/moler
%
%  Input:
%
%    integer N, the order of the matrix.
%
%  Output:
%
%    integer C(N,N): the checkerboard matrix.
%
  [ I, J ] = meshgrid ( 1 : n );

  C = ( mod ( I + J, 2 ) == 0 );

  return
end

