The temperature dependences of both the saturation magnetic field values and the powder diffraction patterns of two Ni-Mn-Ga tetragonal martensites were studied experimentally. A reasonable agreement between the temperature dependences of the lattice parameters determined from the x-ray diffraction data and obtained from the magnetization curves is observed. This experimental finding demonstrates the linear dependence of the magnetic anisotropy constant on the tetragonal distortion of the cubic crystal lattice arising in the course of the martensitic transformation, and hence supports the macroscopic and microscopic theories by L'vov et al (1998 J. Phys.: Condens. Matter 10 4587) and Enkovaara et al (2002 Phys. Rev. B 65 134422), respectively, which predict this dependence.