A classic hysteretic model, Preisach-Mayergoyz model (P-M model), was used to calculate the nonlinear elastic deformation of magnesium (Mg) and cobalt (Co). Mg and Co samples in cylinder shape were compressively tested by uniaxial test machine to obtain their stress—strain curves with hysteretic loops. The hysteretic loops do have two properties of P-M hysteretic systems: wiping out and congruency. It is proved that P-M model is applicable for the analysis of these two metals’ hysteresis. This model was applied on Mg at room temperature and Co at 300 ℃. By the P-M model, Co and Mg nonlinear elastic deformation can be calculated based on the stress history. The simulated stress—strain curves agree well with the experimental results. Therefore, the mechanical hysteresis of these two metals can be easily predicted by the classic P-M hysteretic model.