MATLAB

The difference is clear: MATLAB is the easiest and most productive computing environment for engineers and scientists. It includes the MATLAB language, the only top programming language dedicated to mathematical and technical computing.

In contrast, Python is a general-purpose programming language requiring add-on libraries for performing even basic mathematics.

"With MATLAB, I can code and debug a new capability much faster than with other languages. Cutting our development time in half with MATLAB was instrumental in our ability to meet a tight timeline. Our customer was convinced that I’d worked 70 hours each week when he saw the results."

Bancroft Henderson, EMSolutions

## The matrix-based MATLAB language lets you express math directly.

Engineers and scientists need a programming language that expresses matrix and array mathematics directly instead of through generalized programming constructs.

Matrix math in Python requires function calls, not natural operators, and you must keep track of the differences between scalars, 1-D arrays, and 2-D arrays. Even in the simplest Python code this can be difficult, as the hidden mistake in the following example shows. The same example written in the MATLAB language shows that MATLAB is the more natural way to express computational mathematics.

Ultimately, linear algebra in MATLAB looks like linear algebra in a textbook. The same is true for data analytics, signal and image processing, control design, and other applications.

This is why more than 1,800 textbooks teach using MATLAB.

## Engineers and scientists deserve tools that fit the way they work. They shouldn’t have to adapt the way they work to fit their tools.

Python functions are typically designed and documented by advanced programmers for other experienced programmers. Python development environments for scientific computing lack the reliability and integration of the MATLAB desktop.

Everything about MATLAB is designed specifically for engineers and scientists:

• Function names and signatures are familiar and memorable, making them as easy to write as they are to read.
• New function interfaces undergo a rigorous design process that typically involves dozens to hundreds of developer-hours per function.
• The desktop environment is tuned for iterative engineering and scientific workflows.
• Integrated tools support simultaneous exploration of data and programs, letting you explore more ideas in less time.
• Documentation is written for engineers and scientists, not computer scientists.

“As a process engineer I had no experience with neural networks or machine learning. I worked through the MATLAB examples to find the best machine learning functions for our predictive metrology use case. I couldn’t have done this in C or Python—it would’ve taken too long to find, validate, and integrate the right packages.”

Emil Schmitt-Weaver, ASML

## Proven MATLAB toolboxes provide the functions and capabilities you need. Period.

A programming language must be combined with specialized tools that support what you need to do, whether you’re modeling economic data, analyzing an image sequence, or driving a robot. Those tools need to work, and they need to work together.

Python relies on community-authored packages for scientific and engineering functionality. Python packages vary widely in quality and capabilities. Each package has its own stand-alone documentation, putting the burden on you to piece together a solution.

Unlike Python, MATLAB toolboxes offer professionally developed, rigorously tested, field-hardened, and fully documented functionality for scientific and engineering applications. Toolboxes are designed to work with each other, and they integrate with parallel computing environments, GPUs, and automatic C code generation. They are updated together, so you never struggle with incompatible library versions.

We need to filter our data, look at poles and zeroes, run nonlinear optimizations, and perform numerous other tasks. In MATLAB, those capabilities are all integrated, robust, and commercially validated.

Borislav Savkovic, lead data scientist, BuildingIQ

## MATLAB apps let you complete tasks more easily than with custom programming.

Python doesn’t offer integrated workflow apps for scientific and engineering applications, requiring custom programming instead. This slows down discovery and exploration, especially for highly iterative workflows.

MATLAB apps let you start working right away. These interactive applications combine direct access to large collections of algorithms with immediate visual feedback. You can try a new surface fitting algorithmfilter design technique, or machine learning classification algorithm and see right away how it works with your data. Iterate until you’ve got the results you want, then automatically generate a MATLAB program to reproduce or automate your work.

## MATLAB helps automate the entire path – from research to production.

Major engineering and scientific challenges require broad coordination across teams to take ideas to implementation. Every handoff along the way risks adding errors and delays.

Unlike Python, MATLAB can help teams through their entire workflow:

## MATLAB runs your programs faster – meaning you can try more ideas and solve bigger problems.

Out of the box, MATLAB is faster than Python for common technical computing tasks in statistics, engineering calculations, and data visualization. The following table and chart illustrate benchmark results.

Python code requires overlapping and conflicting add-ons to get performance benefits such as just-in-time compilation and explicit parallel programming. These solutions tend to be incomplete or targeted at advanced programmers.

MATLAB does the hard work of making your code fast. Math operations are distributed across your computer’s cores, library calls are heavily optimized, and all code is just-in-time compiled. You can run your algorithms in parallel by changing for-loops into parallel for-loops, which entails simply adding the three characters “par” to “for”, or by changing standard arrays into GPU arrays. You can run your parallel algorithms in an infinitely scalable public or private cloud with no code changes.

## You can trust the results you get in MATLAB.

Engineers and scientists trust MATLAB to send a spacecraft to Plutomatch transplant patients with organ donors, or just compile a report for management. This trust is built on impeccable numerics stemming from the strong roots of MATLAB in the numerical analysis research community.

A team of MathWorks engineers continuously verifies quality by running millions of tests on the MATLAB code base every day.

## Explore why scientists and engineers choose MATLAB over Python:

### Python

Mathematical syntax

Natural syntax makes programs easier to write and read, improving communication and reducing mistakes.

• Math- and matrix-oriented language
• General-purpose language
• Numeric arrays and data types not part of the core language

Ease of learning for scientific computing

Programming is a means to an end for most engineers and scientists. An easily learned program keeps the focus on the domain, not the programming.

• Beginners write math as they would on paper.
• Non-programmers learn as their needs grow.
• Beginners start by learning advanced programming constructs.
• Users must become programmers before they can be productive.

### Python

Scientific data visualization

Easy visualization lets you see not only the result of your analysis or algorithm but also the behavior of your program.

• Visualization integrated into the core of the MATLAB language and desktop
• Interactive exploration and annotation
• Fragmented visualization tools
• No common interface

Toolboxes that just work

Well-designed add-ons provide essential building blocks for specialized applications. Don't waste time trying to piece together and maintain disparate add-ons.

• Curated toolboxes provide coverage of common engineering and scientific applications.
• Toolboxes designed to work together
• Toolboxes documented in domain-specific language by professional writers
• Package quality, comprehensiveness, and maintenance varies widely
• Documentation written by developers and often assumes software developer skills
• Documentation not integrated across libraries

### Python

Out-of-the-box performance

Scientific computing requires rapid iteration, which is best achieved with programs that without additional optimization.

• High-performance linear algebra, graphics, and statistics
• Optimized library calls
• Just-in-time compilation for fast function calls and loops

Parallel processing and big data for non-experts

You shouldn't have to become an expert in parallel programming just because your problems are too big to run quickly on a single processor.

• Integrated features for writing parallel and big data algorithms for traditional processors and GPUs
• Parallel algorithms scale from multicore desktop machines to clusters and the cloud
• Parallel capabilities integrated across add-ons
• Many competing, unintegrated options for parallelizing scientific calculations
• Most parallel libraries oriented towards experts in parallel computing

### Python

Scientific computing desktop

An excellent development environment can accelerate common tasks by putting everything you need in front of you.

• Development environment refined to facilitate exploration and discovery
• Development environment, language, and libraries integrated so that everything works together
• Data exploration tools enhance analysis and debugging workflows
• Integrated debugger, profiler, and code analyzer improve program quality
• Most IDEs designed for professional software developers
• Widely varying levels of integration between IDEs and libraries

Documentation

Documentation needs to be comprehensive, comprehensible, and available at your fingertips.

• Comprehensive reference and user documentation.
• Documentation viewer integrated with desktop workflows.
• Documentation written for engineers and scientists
• 1000s of examples
• User documentation often limited in depth and breadth
• Documentation for different libraries scattered across different websites
• Documentation often assumes advanced programming knowledge

Apps

Scientific and engineering tasks are performed more quickly and easily with a graphical interface than with programming.

• Apps for performing common tasks
• Complex tasks and techniques accessible without deep expertise
• Task automation through code generation
• No apps for performing engineering and scientific tasks without programming

### Python

Desktop application development and deployment

Allowing non-developers to build custom applications enables the spread of complex technical applications.

• Interactive UI development platform
• UI developer tools designed for engineers and scientists
• Stand-alone executable packaging
• No integrated interactive UI development platform
• Professional UI developer tools requiring advanced programming expertise

Embedded code generation

Automatic C and C++ code generation reduces the time, defect rates, and cost required to move algorithms from research to production

• MATLAB Coder generates readable, portable C and C++ code
• No robust, comprehensive, automatic code generation for embedded systems

Hardware integration

Hardware is essential to many computer-based engineering and scientific workflows, both as a source of data and as a target for algorithms.

• Simple, automated installation and configuration
• Consistent, easy-to-use, high-level interfaces
• Limited, ad-hoc support for integrating with hardware
• Installation and configuration often difficult and time-consuming

Model-Based Design

Scientific computing work often supports larger design projects. Integration with downstream tools minimizes the risk associated with hand-offs.

• Complete set of tools for Model-Based Design
• No support for Model-Based Design

### Python

Professional, real-time support

Reliable, real-time support enables users to get the right answer quickly.

• 95% of support calls answered in 30 seconds or less by Master’s- or Ph.D.-level engineers
• Personalized email and phone support
• Direct contact with developers
• No personalized, real-time support
• Primary support through online resources
• Support resources often require advanced programming knowledge