function x = r8vec_linspace3 ( n, a, b )

%*****************************************************************************80
%
%% R8VEC_LINSPACE3 creates a vector of linearly spaced values.
%
%  Discussion:
%
%    An R8VEC is a vector of R8's.
%
%    4 points evenly spaced between 0 and 12 will yield 1.5, 4.5, 7.5, 10.5.
%
%    In other words, the interval is divided into N+1 even subintervals,
%    and the endpoints of internal intervals are used as the points.
%
%  Licensing:
%
%    This code is distributed under the GNU LGPL license.
%
%  Modified:
%
%    23 August 2016
%
%  Author:
%
%    John Burkardt
%
%  Parameters:
%
%    Input, integer N, the number of entries in the vector.
%
%    Input, real A, B, the first and last entries.
%
%    Output, real X(N,1), a vector of linearly spaced data.
%
  x = zeros ( n, 1 );

  for i = 1 : n
    x(i) = ( ( 2 * n  - 2 * i + 1 ) * a ...
           + (          2 * i - 1 ) * b ) ...
           / ( 2 * n );
  end

  return
end
