function r8vec_print_mask ( n, a, mask_num, mask, title )

%*****************************************************************************80
%
%% R8VEC_PRINT_MASK prints a masked R8VEC.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    02 November 2005
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    integer N, the number of components of the vector.
%
%    real A(N), the vector to be printed.
%
%    integer MASK_NUM, the number of masked elements.
%
%    integer MASK(MASK_NUM), the indices of the vector to be printed.
%
%    string TITLE, a title.
%
  fprintf ( 1, '\n' );
  fprintf ( 1, '  Masked vector printout:\n' );
  if ( 0 < length ( title ) )
    fprintf ( 1, '\n' );
    fprintf ( 1, '%s\n', title );
  end
  fprintf ( 1, '\n' );

  for i = 1 : mask_num
    fprintf ( 1, '  %6d: %6d  %14g\n', i, mask(i), a(mask(i)) );
  end

  return
end
