How to sample a signal in MATLAB