Octave seems great since it’s open and let’s you run Matlab scripts.
A bit offf topic, but is Matlab relevant still? I’ve heard it’s still in use a lot, but what’s the benefit of going with a walled off proprietary $$$ tool when you can use something like this? Python and R also seem like they’re growing so much and are very open.
I just remember taking a class on Matlab and being pretty disappointed in it with how closed it felt. Will totally check out octave tho!
Yes, in traditional industries. Robotics, automotive, industrial automation, and aerospace are using it.
From my experience in automotive, Matlab alone is not the sole selling point, but the proprietary tooling around Matlab for modelling, hardware-in-the-loop simulation and online calibration for various ECUs is unbeatable and saves the OEMs and manufacturers weeks or months of labor and debugging various platforms. And since it's the industry standard all automotive companies use it to collaborate on projects.
There's also the important fact that many users of these tools are not programmers. They could be mathematicians, physicists, chemists, designers, process engineers, test engineers, test drivers, test pilots, etc. and the GUI block-diagram based visual programing paradigm of Matlab tooling allows them to quickly understand, collaborate and iterate on various control schemes that learning how to code. If you're a test pilot or a process engineer, it's much easier to look at a Simulink block diagram and quickly understand the process going on, than to start reading python code.
There are no open source tools that can do all these things and nor is there a market for them as these companies don't mind sticking with Mathworks & Co. and paying them juicy license fees in exchange for getting the user-friendly tools they want that enables them to get the job done.
The network effect is also too strong to disrupt. Every company in the Michigan area serving the auto industry is running Matlab and so is every company in Stuttgart and Bavaria as most big OEMs have international offices in all these regions which must collaborate together. I assume it's similar in aerospace with the likes of Lockheed, Airbus, Rolls-Royce and many other of their suppliers are also deeply entrenched in the Mathworks ecosystem.
Basically entire industries, that don't get much air-time on the start-up focuesd HN, have standardized on Matlab. In a way, it's similar to the semiconductor industry that standardized exclusively on the tools from Synopys, Mentor Graphics and Cadence. Or how how the CAD industry is run by Autodesk, Siemens and Dassault. None of these players will be disrupted by open source alternatives any time soon. Or ever.
MATLAB is ubiquitous in the aerospace industry. There probably isn’t an aircraft or spcecraft built in the west in the last twenty years where matlab wasn’t used.
The two big reasons are simulink and the availability of extremely domain-specific modules.
Simulink is a graphical modeling lanaguage for developing/simulating closed-loop control systems among other things. Flight controls people build aircraft controls in simulink and then the software engineers take it and use it to generate code that can be integrated into the rest of the flight software.
Then Mathworks builds and maintains a specific tool box for every niche engineering domain under the Sun. Need a set of simulink blocks and/or matlab functions for simulating phased-array radar systems? Mathworks has you covered, for an expensive license fee.
Both these things, IMO are ripe for replacement by open-sourced Python-based modules that do the same things, but it would take the right people with the right domain knowledge to have the incentive to do the work.
Replacing Matlab with Python in engineering seems like a very bad idea, given Python's poor performance. Matlab (and most Python) packages get around this by coding everything in C++, then just having users call that C++ code. But then you have to code in C++, which is expensive.
Julia would probably be a better solution for this use case.
The performance of matlab/Python the traditional engineering world isn’t relevant though, its just for modeling/simulation, it never runs in live systems.
It’s way cheaper to just buy a faster machine then to try and retrain a mechanical engineer who learned matlab in college on Julia, at least for now.
Matlab isn't exactly fast, and the same technique is used for python modules.
The problem isn't performance, it's that matlab is a single click install of everything and an ide that takes care of everything for you. By comparison, managing a python environment is a nightmare.
Your last paragraph is why that's never going to happen. You can make a lot more money using Matlab or making Matlab than replacing it just to give it away for free.
You can already find free and open source alternatives for just about everything in Matlab. And yet, even many companies that complain about the cost of Matlab don't use the Python and Octave alternatives. Seems like money is achieving something that other motivators aren't.
"Know your users". Something is preventing them from considering those alternatives as replacements.
There is high resistance to learning new tools in many environments, especially workplaces. Someone who learned a lot of Matlab will not easily be motivated to learn a better tool. And I would claim, that well supported non-proprietary tools like NumPy and other Python Libraries in the ecosystem, or Julia, are inherently better in the long run.
Some people in teaching roles will even further Matlab's spread irresponsibly out of not wanting to learn a new tool. I have seen this myself. A professor showed the students Matlab, instead of using non-proprietary alternatives. He also did not seem interested in learning about anything else, when I used Python + Numpy instead and showed him.
The alternative to Matlab is not necessarily another programming language. Often, it's a purpose-built tool with maybe some scripting built in.
That's what confuses software engineers about Matlab. They see code and think that the work is software engineering, but that's not always the case.
Imagine the reverse scenario. The professor sees you crunching numbers in Python and tries to convince you to switch to Matlab because it's "better". But you're a software engineer, and you still have to do all your software things that Matlab isn't great for. Why would you be interested in it?
Your previous comment suggested nobody will develop that software because it has poor financial outcomes, that was what I was responding to.
Of course you're right in this comment. Just because something exists doesn't mean people will know about it or trust it. Relationships, support, marketing etc that businesses provide go a long way to helping adoption.
Universities are still using Matlab. It's effectively "free" thanks to generous site licenses, and there's a lot of mature curriculum built up around it. The academics in my family (mostly physical sciences) would say "just use Matlab" and consider everything else to be unnecessary fuss.
Python installation is a headache in a classroom setting. Matlab provides an official installer that guarantees that every kid in the class has a working installation and the same user environment by the time the lesson starts.
It seems like Python and R have taken up residence in fields that had no prior loyalty to Matlab, such as biology.
What I've noticed is that where new graduates used to list Matlab on their resumes, now they list Python. In both cases, whether they can actually do anything useful with it or not. Many of those people didn't actually learn to program. Depending on what courses they took, exposure to Matlab or Python may have consisted of pasting some code written by the TA and running it. Students are not unaware that Python is associated with the job market for programmers -- a career "Plan B" that many are considering. At the same time, if someone can program in Matlab, they can learn Python in a jiffy, or vice versa, so it's not a life-or-death choice.
Whether they actually want to use Matlab or Python in their jobs probably depends on what industry they're in, and their interests. None of the traditional engineers in my workplace (mechanical, electrical) do any programming to speak of. Their CAD software does the engineering calculations that they need. For basic data manipulation, including graphing, they're happy with Excel.
I think you should try out Julia, in that case. Julia installation and package management is extremely easy (MUCH easier than Python). The syntax is very similar to a cross between Matlab and Python, so it's easy to pick up if you're used to either of those--it's also a lot more readable than R. And it's way, way faster than either Python or Matlab.
I've been keeping an eye on Julia. Right now my entire work group is using Python, thanks to me introducing it at my site roughly 10 years ago. But I'd rather let "what comes after Python" happen on my own terms, rather than being blindsided by it.
> but what’s the benefit of going with a walled off proprietary $$$ tool when you can use something like this
My day-to-day stack nowadays is mostly Python with a smattering of others, but I’ve been using MATLAB for almost 15 years.
Like any other enterprise software, you’re paying for support and generally very good documentation. If you have a technical issue or even just a development question you get a response from a human within a day or two, often just a few hours.
There are also many domain-specific tools (e.g. Simulink) that do not have similarly functional open alternatives. Octave is great, but can lag behind new language features and generally isn’t 100% cross compatible. Whether or not this affects you is really dependent on your use case.
There are also many domain-specific tools (e.g. Simulink) that do not have similarly functional open alternatives.
It's interesting how close GNU Radio Companion is getting to Simulink's domain. I don't know if that's their plan or if things are just evolving that way, but I like it.
MATLAB is very much still in use by large corporations and national laboratories. I'm currently a full time researcher at MIT Lincoln Laboratory and did a summer internship at MITRE a couple years ago, and MATLAB is/was the de facto standard language for the majority of staff.
If your company can afford it, and if it has good toolboxes for your field, MATLAB is a solid tool. Its plotting capabilities are the gold standard for a large portion of science--python's matplotlib and similar plotting libraries in other languages are in large part based on MATLAB's plotting experience. Others in this thread have mentioned Simulink, which is also top of the line for control theory analysis.
I think an underappreciated capability of MATLAB is its C/C++ code generation, which is quite good. It'll transpile MATLAB source code (with some minimal type annotations) into C/C++ source code that you can take wherever you want.
Having said all that, it still has plenty of flaws including its price tag. One field where I get the sense that it lags is AI/ML--I have never seen a paper introducing a groundbreaking result that uses MATLAB's ML toolboxes.
I prefer Julia / Python / C++ for my own work, but will still reach for MATLAB every once in a while.
very relevant. Mathworks has an iron grip on the defense industry and academia. Like others have said, because of simulink and a paradigm called "model based engineering". Simulink is nice, especially HDL coding tools because writing HDL by hand can be a real pain. I wish Octave made an open source - maybe one day.
As someone who works at a DoD FFRDC, I can confirm this is true. Matlab is the language of choice for 95% of my colleagues who have no CS or programming background, the other 5% is Labview. They write spaghetti code to get the job done. I’ve been scolded for using Python or Julia in programs because no one else can use it/understand it. I’ve wasted hours setting Python environments up for people which is especially hard due to strict firewall rules. Even once it is setup, it is usually to run some script the found on the internet, if it doesn’t do exactly what they need, they give up and move on. Matlab on the other-hand is a one click install with all the packages pre-installed.
I think the reason is that Matlab is more oriented to people that are not programmers, such as mathematicians and engineers, since it's more "user friendly" than python. It has everything is needed (an IDE, interactive REPL, tools to make graphs, graphical tools to build systems without writing code, etc) integrated, no need to install external library or tools, no need to use the CLI, just run the installer and done. The language then is more natural for non programmers (for example array starts as 1 and not 0), and it's use is more similar of the one of a graphical calculator than a programming language.
I think Python is superior, but perceived as difficult for non programmers.
There's a subtle difference between most programming work and non-programmers (usually engineering).
A lot of programmer work is general purpose, create something new in a novel way.
A lot of non-programmer work is highly specialized, tailoring a solution for a specific use case out of existent but adapted parts.
For the latter, it can make a lot of sense to work within a mature ecosystem, where most of the components are already available, even if you sacrifice flexibility when you need to go out of bounds.
And also you adapt your workflow and designs to the tool, not vice versus.
Matlab's Simulink is the best graphical tool for laying out causal systems modeling that I've ever come across. OpenModelica has a similar tool but it is nowhere near the same experience.
There isn't anything else on the market I know of that comes close.
I recently talked to a math postdoc about Python. He said
> "Yea some of the new PhDs try it out until they find out how awful it is!"
I clutched my pearls, aghast, and asked him why he thought Python was awful? He said that the community supported tools have problems, but the toolboxes provided by MATLAB are high quality and just work. I told him that I thought he was misguided, that Python tools work quite well and that the Python community is a strength not a weakness, that when a tool doesn't work well it's an opportunity to contribute.
I use Mathematica, and it's great strength is the curated data available for doing exploratory work. You can link to data with Python, but you need to set it up, but in Mathematica it's there from the installation. There are more things you can pay for and add, but the base installation is cohesive and powerful. Mathematica's notebook preceded Jupyter and is still better. I use the Home edition that I pay for. If I get work that uses Mathematica, I will buy the full version. I tried to use Octave as a substitute for Matlab but wound up moving to Julia. The code is very similar and easy to jump between the two sans the Matlab add-ons, however, Julia is developing a Symlink alternative.
My aversion to Python is a personal bias. It is an easy language to pick up and has won its place. I just don't like it. I was using Lush back in the day (Yann LeCun was one of the creators), and I wish it had won over Python due to my Lisp predilection [1]. It is a Lisp-like syntax that compiles to C.
What's the Julia Simulink alternative called? In Googling it I found sims.jl which isn't quite a simulink alternative so I wonder if you're talking about something else?
He uses whatever software helps him gets his job done and that's it. Software developers and enthusiats in general usually care about free software, other people not so much.
And also we can't pretend that free sotware projects like octave are not playing catch up with its commercial counterparts, it's not like hundreds of paid developers and billions of dollars getting thrown at the development of new features don't make any difference.
The statement about matlab toolboxes is so wrong it's almost funny. The quality of different toolboxes varies dramatically. Some are quite high quality but others are a buggy mess and all of them are expensive. That said, the statement is very field dependent. Fir example I know that many (most) communication theorists are using matlab, because the communications and signals toolbox does so much that would be otherwise tedious to implement. On the other hand many experimentalists in the same field have moved on to python because the instrument toolbox is so buggy and coding GUIs in matlab is an exercise in self mutilation.
To further reinforce the above argument, many environments dominated by Matlab have their instrument control software written in Python. Mathworks have made it pretty easy to call out to Python (although no Conda/Venv support...), they definitely feel the pressure in that area.
(Double checked your username, seems we've discussed the Matlab/Python space before!)
> when a tool doesn't work well it's an opportunity to contribute
That's like trying to convince someone to buy a fairphone and telling them that if the phone is lacking in some area, they can contribute to the design. Maybe you believe in the message and you're willing to make sacrifice, But if you're a math postdoc whose immediate concern is getting a tenured job before time is up, you just use what's easy and works, because you've got other stuff on your plate that is much closer to your expertise (developing new mathematical knowledge).
You're right, and honestly I was just trying to think of something to try to shift the narrative. There are other advantages to Python, personally I really value its expressiveness, the plethora of good tools (Jupyter, PyCharm, Spyder), and the massive amount of libraries in different domains (beyond all the scientific stuff there's Panda3D, pygame, Django), but I don't think these things are selling points to those in the MATLAB world. Having used MATLAB to a medium degree, I know that if you're just trying to get something done you can do it, so a more expressive language is not really a selling point. The extra tools and libraries might be a better talking point, but yea I was just trying to find some angle that I could leverage to make the guy curious about Python.
I think you're both right, but you might be thinking of different tasks and libraries. If we're talking about solving a specific type of PDE, then in that scenario he's probably right that MATLAB will work better out of the box, but if we're talking about logistic regression on data from a messy CSV table, then python will work great and have better usability than MATLAB (IMO). He might also be thinking of versioning and packaging headaches in python, which are quite a pain the first time exposed to them coming from a walled garden environment.
Actually, yes, he did mention packaging headaches as well. MATLAB manages to sidestep the issue by not having a package manager, and basically forcing you to include the literal source code of any non-mathworks dependencies in your repo.
We do need a better story with dependencies in Python, and I'm happy to see there have been several posts over the last week talking about this issue.
That said I think that for academic projects it can be fairly straightforward to handle after an initial learning curve. A lot of projects can be accomplished with just numpy/scipy/matplotlib and maybe a couple other specialty libraries.
MATLAB does not sidestep that issue. It kicks it back to the user to worry about. Dependencies in MATLAB are essentially non existent. It's up to you as the user the manage everything about them.
Well he's right. Python can't scratch the surface of most MATLAB toolboxes (Octave is a lot closer). And Matlab's general user experience and plotting support is just a million miles better. Both languages are fairly bad so I don't think that would be a factor.
Have you tried the Spyder IDE for Python? For me its user experience and plotting support are very MATLAB like. It was the missing IDE that made it possible to get that MATLAB style workflow but do it with Python (or alternatively, to use Python for scientific tasks without having to always be going through CLI or notebooks, each of which have their issues).
You are right Python, R and Julia are good enough for Data Science and Ml. But the Matlab ecosystem is deeply intertwined for a variety of fields, including ones that don't require coders.
My wife has been using primarily Python in her latest postdoc in those fields so there is hope! Admittedly that might just be on the ML side of the field though
My impression is that 10 years ago, Matlab had a few things going for it in terms of plotting, general usability,... that made it a valid competitor for eg R, even if you didn't depend on some of its more unique features like Simulink. Nowadays, I consider it essentially legacy. R has pulled so far ahead in terms of plotting/data manipulation/apps that it would be a no-brainer even if there was no price difference. What used to be a Matlab-R choice is now an R-Python choice, maybe Julia. I happen to have to maintain a fairly large Matlab codebase, if we were to start over it'd definitely be one of those, probably R. I still like the Matlab IDE best, but that's not going to keep me. The most annoying thing is that you have to buy another license on top of the regular one for most interesting things (even the optimization toolbox costs extra, so does statistics, ML, DL - and they're still no match for R or Python).
As many others have pointed out, Matlab is not only relevant, but thriving in many fields. It's a great package and is deeply embedded into the engineering world.
I won't repeat points others have made, but here are a few of my observations:
* Matlab is a great language for domain specialists -- non-programmers who want to solve technical problems. There is almost no barrier to entry to Matlab for such users -- you just start using it at the command line. Python and Julia assume the user is a programmer -- you need to worry about variable types, quirky syntax, finding and importing the right libraries, etc.
* Julia started out as a next step beyond Matlab for numeric computation. It was relatively easy to use at the beginning. However, the language has now grown and generalized to the point where I find that it has become as difficult to use as C++. For example, error messages thrown by Julia can be multiple screens long and are as hard to read as C++ errors. And getting types right is a pain. Here's the Julia manpage discussing all the types you need to worry about when writing Julia programs:
Maybe hard-core programmers love the available abstractions, but this level of complexity is a real turn-off for domain specialists who just need to crunch some numbers.
* Matlab is highly performant. The Mathworks implemented a JIT some years ago which largely mitigated the need to write (tortured) vectorized code. On the other hand, "for" loops in Octave are still dog-slow since it's interpreted on a line-by-line basis.
* Matlab has tons of toolboxes implementing advanced functionality. The toolboxes are widely used in industry. Octave mostly lacks this toolbox ecosystem.
* As others have mentioned, Simulink provides a graphical tool used almost everywere to design control systems. The control systems guys at my workplace use it. There is also an open-source alternative to Matlab/Simulink, Scilab/Xcos, which was originally written at a French university but is now owned by Dessault:
Unfortunately, I have never seen anybody on this side of the Atlantic Ocean use Xcos for anything, but I see Simulink all over the place.
* Finally, I'll point out that the Mathworks remains very innovative and continues to invest in their products. Their stuff is improving in quality and extending into new domains. I agree Matlab's price tag is steep for individual users, but for companies the price is a drop in the bucket, and the Mathworks puts its revenues to good use. I can think of many other software companies who charge far more for their stuff, but simply collect their revenues and leave their products to stagnate. The Mathworks is a good model of what a commercial software company should be.
For those who can't pay for Matlab, Octave and Scilab are both good enough for home use.
> For example, error messages thrown by Julia can be multiple screens long and are as hard to read as C++ errors.
The good news is this can be fixed by using AbreviatedStackTraces.jl, which will probably be added to the base language in the next update (1.10).
> And getting types right is a pain.
Julia's types are almost identical to Python's. Julia is dynamically-typed, with optional type annotations. You don't have to touch types, ever, if you don't want to. I never worry about types when I write Julia programs.
Wow, I didn’t know you don’t need to vectorize Matlab code anymore! Though that’s a useful skill to have, has saved my skin a few times in scientific Python land too!
It has some add-ons (tool-boxes) that aren't as complete or don't exist in the open source world and would be a big lift to reimplements. If you are just writing all your own code there isn't any advantage over python, Julia, etc.
A bit offf topic, but is Matlab relevant still? I’ve heard it’s still in use a lot, but what’s the benefit of going with a walled off proprietary $$$ tool when you can use something like this? Python and R also seem like they’re growing so much and are very open.
I just remember taking a class on Matlab and being pretty disappointed in it with how closed it felt. Will totally check out octave tho!