function value = p01_f ( n, x )

%*****************************************************************************80
%
%% p01_f() evaluates the function for problem p01.
%
%  Discussion:
%
%    Step function.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    06 August 2012
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    integer N, the number of evaluation points.
%
%    real X(N,1), the evaluation points.
%
%  Output:
%
%    real VALUE(N,1), the function values.
%
  value = 2.0 * ones ( size ( x ) );

  i = find ( x <= 1.0 / 3.0 );
  j = find ( 4.0 / 5.0 <= x );

  value(i) = -1.0;
  value(j) = +1.0;

  return
end
