The Decline of MATLAB: What Engineers Should Learn Instead
A frank look at why Python and Rust is the future of the hardware programming stack.
Welcome to the weekday free-edition of this newsletter that is a small idea, an actionable tip, or a short insight that takes less than 5 minutes to read. If you’re new, start here!
If you’re not a premium subscriber, here’s paid content from July you are missing out on.
Understanding High-Voltage DC Power Architectures for AI Megafactories
A Detailed Playbook to Leveling Up Your Meetings, Mentorship, and Career Conversations
If you’ve done any hardware programming in engineering school or as a hobbyist, chances are you’ve used MATLAB. For a long time, it was the default tool for anyone learning technical computing.
MATLAB was actually the first programming language I learned, close to two decades ago. But about ten years back, I moved entirely to Python. The company I was with didn’t have sufficient MATLAB licenses or the toolboxes I needed, so I took it as a chance to pick up something new. I’ve been using Python ever since, and I’m guessing I’m not alone.
Python, with its open ecosystem and vibrant online community really caught on in the early 2010s. Python’s ecosystem—Scikit-Learn, Pandas, NumPy, SciPy—grew rapidly and gained traction among scientists and engineers. As these tools became more powerful and widely adopted, it became increasingly difficult to justify the license fees that MATLAB demands. Even with free MATLAB alternatives like GNU Octave, the growing ecosystem of packages in Python is still simply too hard to resist.
For embedded programming and systems control, which are highly relevant to IoT, robotics, and real-time systems, the dominance of C/C++ is being challenged by Rust, a memory-safe alternative that uses a safety-first approach to programming instead of C/C++’s permissive-by-default approach. Today, the Linux kernel even supports experimental development in Rust. The 2024 Developer Survey by StackOverflow shows key insights when comparing MATLAB to Python, or C++ to Rust.
Python is the most desired language (41.9% although it has its fair share of haters.)
Rust is the most admired language (82.2%), and supersedes C/C++ in both admiration and desirability.
MATLAB is the least admired language (21.2%, and even worse than Cobol at 26.2%).
MathWorks also offers Simulink for system level simulations that is being challenged by alternatives such as:
Modelica (or openModelica, the open-source version), which you can learn more about here.
Pictorus, a browser first system simulation tool that uses Python and Rust under the hood. Pictorus is also free to use for individuals, and is a great alternative for scrappy teams to get their projects off the ground quickly.
Scilab with XCOS, which is entirely free and open-source.
Then, there are licensed alternatives like MapleSim (by Altair, acquired by Siemens), or SCADE (by Ansys, acquired by Synopsys).
Should you learn MATLAB?
Unless you’re going to work in industries that are deeply entrenched in MATLAB already like aerospace and automotive, there is little incentive today to build your skills on MathWorks’ platform products.
Commercial licenses are expensive and every toolbox needs separate purchase. There are ‘home’ versions that are cheaper, but you still have to buy toolboxes separately for use.
The syntax you learn is not transferrable to general purpose programming. If you encounter things that the MATLAB suite does not do as well, you’ll be stuck.
The closed ecosystem and corporate decisions on where innovations should go is inherently limiting. Open source alternatives like Python have ecosystems that develop much faster.
In short, the answer is no. Chris Sullivan eloquently explains this in his blog post — What is happening to MATLAB?
MathWorks is going to start showing the signs of collapse, either due to flight from expensive MATLAB to free Python, the lack of new grads interested in the language, or a transition away from C to Rust that they are not well-positioned to weather let alone lead.
What should you learn instead?
If the trends from the Stack Overflow survey are indicative of the state of programming today, your software skills for hardware engineering projects will be well served by learning Python and Rust.
Python will cover all your needs for scripting, data analysis, machine learning, and hardware programming. There are plenty of open-source packages available, and maintained by top programmers in their respective domains. The syntax is easy to learn, and you’ll be up and running in no time.
Python does have its downsides when it comes to speed and dependency management, but it should suffice for most projects. If speed is your real concern, then you can look at Julia instead (it ranks pretty high on the admiration scale.)
Rust is not easy to learn. The significant learning curve is offset by the speed and safety that the language offers. Given its high admiration as a programming language and steep learning curve, Rust expertise gives you a technical moat most cannot encroach. The official webpage has substantial learning resources if you’re up for the challenge.
Both Python and Rust are general purpose programming languages with their strengths and weaknesses. Learning them will ensure that your programming skills are transferrable across a wide range of industries and applications.
While this suggestion may work as a prescribed starting point, I do realize that this by no means applies to all of hardware engineering. There are unique situations where certain programming languages are still perfect suited for what they do.
If you think learning programming is no longer necessary due to AI, I’ll just emphatically say that is never going to be the case in hardware engineering. Sure, AI will speed things up, but will never displace your foundational understanding.
What other programming languages are relevant for hardware engineers today?
What do you recommend and how difficult is it to learn?
Let me know in the comments below.
Nice article. Thanks. I'll be looking into Rust.
I started on Matlab in 1987 (not a typo), when I was an u'grad at Drexel University and Matlab ran on a VAX mini-mainframe. Matlab is tried and true - diverse and priced "a la carte" to control your costs. If you need support, they are there. Mathworks is a great, no nonsense company.
I code in a few languages, not expert at any. I picked up Python in the mid-2010 and moved onto Anaconda (due to dependency management issues - and cyber BS - I just found a virus from 2018 from Python downloads a few months back...no virus def for it then). Still, if you want to handle multi-dimensional arrays, Python is quite good. Maybe the best at that.
For others who like BOTH, here's a link:
https://www.mathworks.com/content/dam/mathworks/fact-sheet/calling-python-from-matlab-cheat-sheet.pdf
Connect anytime. We focus on Machine and Computer Vision, but are experts in systems and control with some solid "Data Science" chops. Vision Optronix. Cheers.
Another big reason to learn Rust is the tooling. As much as the actual language can be difficult to grasp I'd say the surrounding tools for building and dependency management are extremely easy to use unlike what you'd find in C or C++. Cargo is definitely a big reason to make the switch. There's even some Rust based tools for Python as well at https://astral.sh