MATLAB codes for BEEP