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 GNU LGPL license. 
%
%  Modified:
%
%    09 July 2017
%
%  Author:
%
%    John Burkardt
%
%  Parameters:
%
%    Input, integer N, the number of components of the vector.
%
%    Input, integer A(N), the vector to be printed.
%
%    Input, integer MASK(N), the mask.  Nonzero elements correspond to
%    vector elements that should be printed.
%
%    Input, 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
