function x = hamming_null_right ( m, n )

%*****************************************************************************80
%
%% HAMMING_NULL_RIGHT returns a right null vector of the HAMMING matrix.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    11 March 2015
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    integer M, N, the order of the matrix.
%
%  Output:
%
%    real X(N,1), a null vector
%
  if ( n ~= ( ( 2 ^ m ) - 1 ) )
    fprintf ( 1, '\n' );
    fprintf ( 1, 'HAMMING_NULL_RIGHT - Fatal error!\n' );
    fprintf ( 1, '  M = %d\n', m );
    fprintf ( 1, '  N = %d\n', n );
    fprintf ( 1, '  but N = 2^M-1 is required.\n' );
    error ( 'HAMMING_NULL_RIGHT - Fatal error!' );
  end

  if ( m < 2 )
    fprintf ( 1, '\n' );
    fprintf ( 1, 'HAMMING_NULL_RIGHT - Fatal error!\n' );
    fprintf ( 1, '  M must be at least 2.\n' );
    error ( 'HAMMING_NULL_RIGHT - Fatal error!' );
  end

  x = zeros ( n, 1 );

  x(1,1)       =  1.0;
  x(n+1-m:n,1) = -1.0;

  return
end
