A library of useful MATLAB functions