  Two porous carbon-based samples doped with Au and Co are investigated. The
neutron diffraction study reveals an amorphous structure of both samples. The
Co-doped sample exhibits a long-range ferromagnetic (FM) ordering at 2.6 K. The
NMR investigations demonstrate, that the samples are obtained with a partial
carbonization of initial aromatic compounds and do not reach a state of glassy
carbon. The magnetization, longitudinal nonlinear response to a weak ac field
and electron magnetic resonance data give evidences for presence of FM clusters
in the samples well above 300 K. A short-range character of the FM ordering in
the Au-doped sample transforms below T$_C \approx$ 210 K into another
inhomogeneous FM state. Besides the FM clusters, this state contains a
subsystem with a long-range FM ordering (matrix) formed by paramagnetic
centers, existing outside the clusters. The nonlinear response data suggest a
percolative character of the long-range FM matrix, which is connected probably
with a porous sample structure. The magnetization data give evidence for the
formation of an inhomogeneous state in the Co-doped sample, similar to that in
the Au-doped one. However, this state is formed at higher temperatures, lying
well above 350 K, and exhibits a more homogeneous arrangement of the FM
nanoparticles and the FM matrix. Temperature dependence of the magnetization in
the Au-doped sample is attributable to changes of the domain formation regime
in the FM matrix on cooling, connected with the inhomogeneous character of its
FM state. Such peculiarity is absent in the Co-doped sample below 350 K, which
is in agreement with formation of the FM state in this sample at much higher
temperatures. Further cooling below T ~ 3(10) K leads to a steep increase of
the magnetization in both samples. This is attributable to the domain
rearrangement in the inhomogeneous FM state at low temperatures.
