Matlab project reproducing (and extending) Patel2001