To achieve a magnetic nanocomposite, iron oxide nanoparticles are prepared by high temperature decomposition of iron organic precursor and then they are infiltrated into oriented pores of a porous silicon (PS) matrix. The PS is fabricated by anodization of a n+ silicon wafer in aqueous HF solution. The magnetic behavior of this composite is determined by the morphology of the matrix as well as by the distribution of the particles within the individual pores. The composite offers FM/SPM switching due to dipolar coupling between the particles, whereas the transition temperature can be tuned in a broad range by the coating of the particles and the concentration of the particle solution. The anisotropy between two magnetization directions (magnetic field parallel and perpendicular to the pores) can be modified by varying the morphology of the PS matrix.