Small code for my MATLAB usage.