function i4vec_print_mask ( n, a, mask, title )

%*****************************************************************************80
%
%% i4vec_print_mask() prints masked elements of an I4VEC.
%
%  Discussion:
%
%    Vector elements with a nonzero mask will be printed.
%
%  Licensing:
%
%    This code is distributed under the MIT license. 
%
%  Modified:
%
%    09 July 2017
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    integer N, the number of components of the vector.
%
%    integer A(N), the vector to be printed.
%
%    integer MASK(N), the mask.  Nonzero elements correspond to
%    vector elements that should be printed.
%
%    string TITLE, a title.
%
  fprintf ( 1, '\n' );
  fprintf ( 1, '  (MASKED):  %s\n', title );
  fprintf ( 1, '\n' );

  for i = 1 : n
    if ( mask(i) ~= 0 )
      fprintf ( 1, '  %6d: %10d\n', i, a(i) );
    end
  end

  return
end
