Structure and magnetic properties of nanoparticles trapped in a carbon matrix along with the catalytic growth of carbon nanotubes