function a = r8row_running_average ( m, n, v )

%*****************************************************************************80
%
%% R8ROW_RUNNING_AVERAGE computes the running averages of an R8ROW.
%
%  Discussion:
%
%    An R8ROW is an M by N array of R8's, regarded as an array of M rows,
%    each of length N.
%
%  Licensing:
%
%    This code is distributed under the GNU LGPL license.
%
%  Modified:
%
%    23 February 2016
%
%  Author:
%
%    John Burkardt
%
%  Parameters:
%
%    Input, integer M, the number of rows.
%
%    Input, integer N, the number of items in each row.
%
%    Input, real V(M,N), the data.
%
%    Output, real A(M,N+1), the running average.  A(I,J) is the average value
%    of V(I,1:J-1).
%
  a = zeros ( m, n + 1 );
%
%  Sum.
%
  for j = 2 : n + 1
    a(1:m,j) = a(1:m,j-1) + v(1:m,j-1);
  end
%
%  Average.
%
  for j = 2 : n + 1
    a(1:m,j) = a(1:m,j) /  ( j - 1 );
  end

  return
end
