Multiwalled carbon nanotube (MWCNT) crosslinked polyurethane nanocomposites filled with iron (Fe) powders were synthesized by an in situ polymerization method. The Fe powders were deposited on one side of the nanocomposites during sample formation. Because of the gradient distribution of the Fe powders, the polymer part was affected little; this resulted in good mechanical properties of the nanocomposites. The electrical conductivities on each side of the nanocomposites were different. Because of the good magnetic properties and high electrical conductivities of the nanocomposites, the shape-memory effect could be induced by temperature heating (temperature = 45°C), electrically resistive Joule heating (voltage (U) = 30 V), and magnetic field heating (frequency (f) = 45 kHz, intensity of magnetic field (H) = 46.5 kA/m). The shape-memory properties were dependent on the location of the side that contained the most Fe powders (Fe side), and the nanocomposites showed better shape-memory properties when the Fe side was located inside of the folded samples. © 2013 Wiley Periodicals, Inc. J. Appl. Polym. Sci. 2014, 131, 40220.