Python Code Using Functions In Matlab