  We present an output-sensitive algorithm for generating the whole set of
flats of a finite matroid. Given a procedure, P, that decides in S_P time steps
if a set is independent, the time complexity of the algorithm is O(N^2 M S_P),
where N and M are the input and output size, respectively. In the case of
vectorial matroids, a specific algorithm is reported whose time complexity is
equal to O(N^2 M d^2), d being the rank of the matroid. In some cases this
algorithm can provide an efficient method for computing zonotopes in
$H$-representation, given their representation in terms of Minkowski sum of
known segments.
