A ESR spincounting script for MATLAB