Transitioning from MATLAB to Python

Author: Alexandre Chabot-Leclerc, Ph.D., Director, Training Solutions

Download the guide here.

If you are not yet a user of Python, and its move to become the most common programming language has piqued your interest, the Enthought training team has updated its popular reference guide, ‘Transitioning from MATLAB® to Python’. The guide highlights some of the most important differences between the two languages, including:

  • The fundamental data types
  • How code is organized in packages 
  • An overview of the syntax differences
  • How indexing and slicing work
  • NumPy arrays compared to MATLAB matrices
  • How Python mainly uses an object-oriented programming paradigm.

In addition, the guide explores common tasks when doing data analysis or running simulations, with a focus on the most common packages used for each task, such as loading data, cleaning and reformatting data, performing analysis or simulation, plotting, and saving data. 

Finally, it introduces two strategies to transition gradually to Python. Both rely on testing to validate that the new Python code works the same way as your MATLAB® code. The problem is approached in 2 ways; by either converting all functions directly to Python or by calling Python from MATLAB®

Download the guide here.

Watch the webinar on migrating from MATLAB to Python here.

MATLAB to Python


Why transition from MATLAB® to Python?

If you’re unsure of whether you’d like to transition to Python, we’ve collected some of the most commonly cited reasons for the change. Cost is often the first reason given, as licensing fees add up quickly and may account for a significant part of a small organization’s budget. Python has the appeal of being free, because you do not have to pay a license fee and you have access to many free open source packages. 

Choosing Python – or any other open source language – lets you run your code without being locked-in with a given provider. There is no need to pay a license fee in order to keep your software running. More importantly, it means that colleagues, and others, can run Python code without requiring a license. This can greatly improve the chances of survival for your project.

Finally, Python has the benefit of being a general purpose programming language. Though it is an excellent language for scientific computing, it is not solely a scientific computing language. It can be used to do everything from building a file synchronization system, a photo-sharing service, a 3D modeling and video-editing application, and a video hosting platform, to  discovering gravitational waves. 

The consequence of such varied uses is that you can find tools to do almost all common tasks. This allows you to use Python for your entire application, from hardware control and number crunching, to web API and desktop application. And for cases when a feature or a library exists only in another language, Python can easily interface with C/C++ and Fortran libraries. There are also Python implementations for some of the major other languages, such as IronPython for C, and Jython for Java.

Download the guide here.


Build your Python skills

Enthought offers a number of Python training courses for those looking to improve their skills. If you are currently a MATLAB user, we recommend Enthought’s Python for Scientists and Engineers as the perfect entry point into the scientific Python world. Sign up for a training session through our website, or contact us to learn more about our on-site corporate programs.


About the Author

Alexandre Chabot-Leclerc, Ph.D., Director, Training Solutions holds a Ph.D. in electrical engineering and a M.Sc. in acoustics engineering from the Technical University of Denmark and a B.Eng. in electrical engineering from the Université de Sherbrooke.

Share this article:

Related Content


Enthought GKチームは、東京で開催されたライフサイエンスカンファレンス「ファーマIT&デジタルヘルスエキスポ2022」に出展し、技術的な見識と市場成長の活性化を求めて集まる製薬業界のリーダーたちと会談しました。三日間の会期中に200社が出展し、6700人以上の参加者が集まりました。 デジタルトランスフォーメーションが主要テーマである本展示会は、当社のターゲットとする企業に、製薬業界の新薬開発を加速させる当社のサービスを

Read More

Life Sciences Labs Optimize with New Digital Technologies and Upskilling

Labs are resetting the tr…

Read More

Digital Transformation of the Materials Science R&D Lab

“Digital transforma…

Read More

Scientists Who Code

Digital skills personas f…

Read More

Digital-centric R&D Laboratories

To have a transformative …

Read More

Join Our Mailing List!

Sign up below to receive email updates including the latest news, insights, and case studies from our team.