Please note, this is a STATIC archive of website www.tutorialspoint.com from 11 May 2019, cach3.com does not collect or store any user information, there is no "phishing" involved.
The Python libraries are now available in MATLAB (since 2014b). We can run code directly in MATLAB if we are using version 2014b or later.
This makes it possible to use python modules in MATLAB. Without any other changes, just prefix ‘py’ before the python library name you want to use. Let us use the Python calendar module as an example.
To run our own function, we can create a file in our current MATLAB working directory. Let’s say we created a file called ‘hello.py’ that contains these two lines:
def world():
return 'hello world';
# In MATLAB, if we run the following command we get following output