function a_rank = rref_rank ( A )

%*****************************************************************************80
%
%% rref_rank() returns the rank of a matrix, using the reduced row echelon form.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    05 December 2024
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    real A(M,N), the matrix to be analyzed.
%
%  Output:
%
%    integer A_RANK, the estimated rank of A.
%    0 <= A_RANK <= min ( M, N ).
%
  [ A_REF, a_cols ] = rref_compute ( A );

  a_rank = length ( a_cols );

  return
end

