This-work is motivated by the unexpected experimental observation that field gradients can control the alignment of nonmagnetic nanorods immersed inside magnetic fluids. In the presence of local field gradients, nanorods were observed to align perpendicular to the external field at low field strengths, but parallel to the external field at high field strengths. The switching behavior results from the competition between a preference to align with the external field (orientational potential energy) and preference to move into regions of minimum magnetic field (positional potential energy). A theoretical model is developed to explain this experimental behavior by investigating the statistics of nanorod alignment as a function of both the external uniform magnetic field strength and the local magnetic field variation above a periodic array of micromagnets. Computational phase diagrams are developed which indicate that the relative population of nanorods in parallel and perpendicular states can be adjusted through several control parameters. However, an energy barrier to rotation was discovered to influence the rate kinetics and restrict the utility of this assembly technique to nanorods which are slightly shorter than the micromagnet length. Experimental results concerning the orientation of nanorods inside magnetic fluid are also presented and shown to be in strong agreement with the theoretical work.