Electroplated hard magnetic material and its application in microelectromechanical systems