I believe you want to implement 'fmmod' and 'fmdemod' on a square pulse.
According to the Nyquist-Sampling theorem, the sampling frequency used should be greater than twice the most significant frequency content in the message. In practice, it is best to buffer some frequency gap between the sampling frequency and twice of frequency content rather than using the limiting cases of the Nyquist theorem.
The sampling frequency here is suggested to be more than the sum of contents of frequency deviation and highest frequency together.
Please refer to the following example for a sinusoidal waveform through 'fmmod' and 'fmdemod' on the MATLAB Documentation page.