Wavelength measurements of Rosensweig instabilities in a ferrofluid in a non-uniform magnetic field