Added the matlab code