Added matlab script functions