Modularized data cleaning (MATLAB)