Author: Jason Baker (Red Hat), Seth Kenlon (Red Hat), Translator: Lawyer Deng Chao (tmtlvshi), CC BY-SA 4.0, Original link: https://opensource.com/alternatives/matlab
João Trindade, modified by Jason Baker, CC BY-SA 2.0.
Note: This article was originally published in June 2016 and has been updated to provide you with additional options you may want to consider.
For many students in fields such as mathematics, physics, engineering, economics, and others that involve a significant amount of numerical components, MATLAB is often their first introduction to programming or scientific computing.
MATLAB is a great learning tool, although (in my experience) many of the things students and researchers do with it are not particularly demanding in terms of computation. Instead, a variety of basic scripting tools (whether or not they come with statistical or mathematically oriented packages) could easily handle the tasks. However, it is nearly ubiquitous in many academic environments, resulting in a large community of users familiar with the language, plugins, and functionalities.
However, MATLAB is a proprietary tool. Without access to its source code, your understanding of how it works and how to modify it is limited. For many outside of academic settings, it is also too expensive, with a single license potentially costing thousands of dollars.
Fortunately, there are many excellent open-source alternatives. Depending on your exact goals, you may find one or another to be better suited to your specific needs. Here are four alternatives to consider:
GNU Octave
GNU Octave may be the most well-known alternative to MATLAB. With nearly thirty years of active development, Octave runs on Linux, Windows, and Mac, and has been packaged for the major distributions. If you are looking for a project that is as close as possible to the actual MATLAB language, Octave may be a great fit for you; it strives for exact compatibility, so many projects developed for MATLAB can run in Octave without modification.
In addition to the defaults now provided with version 4, Octave also offers various options for front-end interaction. Some are more akin to MATLAB’s interface than others. The Wikipedia page for Octave lists several options.
Octave is licensed under the GPL and its source code can be found at the GNU download site (ftp://ftp.gnu.org/gnu/octave).
NumPy
NumPy (https://numpy.org/) is the primary package for scientific computing with Python (as the name suggests). It can handle N-dimensional arrays, complex matrix transformations, linear algebra, Fourier transforms, and acts as a gateway for C and C++ integration. It has been used in the development of games and movie visual effects and is the fundamental data array structure in the SciPy Stack (an ecosystem of Python-based mathematics, science, and engineering software). NumPy is licensed under the BSD license, and the package is available for Linux, Windows, and Mac OSX.
Scilab
Scilab (https://www.scilab.org/) is another open-source option for numerical computing that runs on all major platforms: including Windows, Mac, and Linux. Scilab is perhaps the most well-known alternative after Octave, and (like Octave) its implementation is very similar to MATLAB, although exact compatibility is not the goal of the project developers.
Scilab is released as open-source software under the GPL-compatible CeCILL license, and its source code is available on the project website.
Sage
SageMath (https://www.sagemath.org/index.html) is another open-source mathematics software system that may be a good choice for those seeking alternatives to MATLAB. It is built on various well-known scientific computing libraries based on Python, 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 the GPL license, and its source code can be found on the project website.
This list is just the tip of the iceberg for tools that researchers and students might choose as open-source alternatives to MATLAB. R, Julia, Python, and other standard programming languages may be better suited to you depending on your actual needs. Other open-source tools you might consider include:
-
Genius Mathematic Tool (http://www.jirka.org/genius.html), an actively developed calculator program and research tool. It is written in the Genius extension language suitable for Linux and Unix computers and is available under the GPL GNU license.
-
Maxima (http://maxima.sourceforge.net/) is another frequently updated alternative to MATLAB. It is based on Macsyma (a “legendary computer algebra system” developed by MIT in the 1960s), can be compiled on Linux, Mac OS X, and Windows, and is available under GPLv2.
-
SymPy (https://www.sympy.org/en/index.html), another BSD-licensed library for symbolic mathematics in Python. It can be installed on any computer running Python. It aims to be a full-fledged computer algebra system; there is an active development community that releases updates regularly; and it is used in many other projects (including the aforementioned SageMath).
Have you used any of these tools or others as alternatives to MATLAB? Which one do you prefer? Why? Let us know in the comments below.
About the Author
Jason Baker: I use technology to make the world more open. A Linux desktop enthusiast. A mapping/geospatial nerd. A Raspberry Pi tinkerer. A data analysis and visualization geek. Occasionally writes code. A cloud-native advocate. A booster for civic technology and open government.
Seth Kenlon: Seth Kenlon is an independent multimedia artist, a free culture advocate, and a UNIX geek. He often works simultaneously in both the film and computer industries. He is one of the maintainers of the Slackware-based multimedia production project http://slackermedia.info.