Ecency
Code in MATLAB #1