  We use a dynamical system approach to study the cosmological viability of
$f(R,\mathcal{G})$ gravity theories. The method consists of formulating the
evolution equations as an autonomous system of ODEs, using suitable variables.
The formalism is applied to a class of models in which $f(R,\mathcal{G})\propto
R^{n}\mathcal{G}^{1-n}$ and its solutions and corresponding stability are
analysed in detail. New accelerating solutions that can be attractors in the
phase space are found. We also find that this class of models does not exhibit
a matter-dominated epoch, a solution which is inconsistent with current
cosmological observations.
