Editor's note: This article was originally published in June 2016, and has been updated to provide some additional options which you may wish to consider.
For many students in mathematics, physical sciences, engineering, economics, and other fields with a heavy numeric component, MATLAB is their first introduction to programming or scientific computing in general.
It can be a good tool for learning, although (in my experience) many of the things that students and researchers use MATLAB for are not particularly demanding calculations; rather they could easily be conducted with any number of basic scripting tools, with or without statistical or math-oriented packages. However, it does have a near ubiquity in many academic settings, bringing with it a large community of users familiar with the language, plugins, and capabilities in general.
But MATLAB is a proprietary tool. Without access to its source code, you have limited understanding of how it works and how you can modify it. It is also prohibitively expensive for many people outside of an academic setting, where license fees for a single copy can reach into the thousands of dollars.
Fortunately, there are many great open source alternatives. Depending on your exact objective, you may find one or another will better fit your specific needs. Here are three to consider:
Julia
Julia is a dynamically typed programming language featuring Lisp-style macros, built-in primitives for parallel computing, and functions designed for matrix manipulation, data visualization, and much more. It's designed to feel like a scripting language rather than a C-style programming-language and even has an interactive mode (REPL), and can be embedded into other languages through its embedding API.
Users of Julia have many reasons for loving its syntax and capabilities, but some of the popular examples include its broadcasting feature, which lets you apply a function to one or more arrays without a writing a complex loop, its simple array functions that let you rotate and reshape arrays, matrix transforms, autodiff, native Unicode support, integrated unit testing, easy paralellisation, and all-round simpler syntax with no loss of functionality (and improved code efficiency.)
Julia has an active community around its development and its use, so it's also been tailored for domain-specific purposes, including image processing (JuliaImages), biology (BioJulia), quantum physics (QuantumBFS), nonlinear dynamics (JuliaDynamics), economics (QuantEcon), astronomy (JuliaAstro) and more.
Julia is licensed under the MIT license, and can be downloaded from julialang.org.
GNU Octave
GNU Octave may be the best-known alternative to MATLAB. In active development for almost three decades, Octave runs on Linux, Windows, and Mac—and is packaged for most major distributions. If you're looking for a project that is as close to the actual MATLAB language as possible, Octave may be a good fit for you; it strives for exact compatibility, so many of your projects developed for MATLAB may run in Octave with no modification necessary.
Octave has many different choices available for a front-end interaction outside of the default that now ships with version 4; some resemble MATLAB's interface more than others. Octave's Wikipedia page lists several options.
Octave is licensed under the GPL, and its source code can be found on the GNU download site.
NumPy
NumPy is the main package for scientific computing with Python (as its name suggests). It can process N-dimensional arrays, complex matrix transforms, linear algebra, Fourier transforms, and can act as a gateway for C and C++ integration. It's been used in the world of game and film visual effect development, and is the fundamental data-array structure for the SciPy Stack, an ecosystem of Python-based math, science, and engineering software. NumPy is licensed under the BSD license, and packages are available for Linux, Windows, and Mac OS X.
Scilab
Scilab is another open source option for numerical computing that runs across all the major platforms: Windows, Mac, and Linux included. Scilab is perhaps the best known alternative outside of Octave, and (like Octave) it is very similar to MATLAB in its implementation, although exact compatibility is not a goal of the project's developers.
Scilab is distributed as open source under the GPL-compatible CeCILL license, and its source code is available on the project website.
Sage
SageMath is another open source mathematics software system that might be a good option for those seeking a MATLAB alternative. It's built on top of a variety of well-known Python-based scientific computing libraries, and its own language is syntactically similar to Python. It has many features including a command-line interface, browser-based notebooks, tools for embedding formulas in other documents, and of course, many mathematical libraries.
SageMath is available under a GPL license, and its source code can be found on the project website.
This list only scratches the surface of tools that researchers and students may choose to use as open source alternatives to MATLAB. R, Julia, Python, and other standard programming languages might be a good fit for you, depending on your exact needs. Some other open source tools you may want to consider include:
- Genius Mathematic Tool, an actively developed calculator program and research tool. It is written in Genius Extension Language for Linux and Unix computers and is available under the GPL GNU license.
- Maxima, another frequently updated alternative to MATLAB. It's based on Macsyma, a "legendary computer algebra system" developed at MIT in the 1960s, can be compiled on Linux, Mac OS X, and Windows, and is available under GPLv2.
- SymPy, another BSD-licensed Python library for symbolic mathematics. It can be installed on any computer running Python. It aims to become a full computer algebra system; has an active development community with regular releases; and is used in many other projects (including SageMath, above).
Have you used any of these or other tools as alternatives to MATLAB? Which one do you prefer and why? Let us know in the comments below.
44 Comments