Added Matlab Code

Added Matlab versions of the code.