4 ms·
I used MATLAB for 15 years. It had and still has a great IDE, and Simulink is great for control systems experiments. Licensing cost is a perennial issue, but ed
by wenc 6y ago
I used MATLAB for 15 years. It had and still has a great IDE, and Simulink is great for control systems experiments. Licensing cost is a perennial issue, but educational institutions get such steep discounts that it's usually not an consideration in academia.
The language is easy to teach and is mostly based on matrix operations. It's great for writing simple functions/subroutines. It's essentially a simplified version of Fortran.
However, it is not a great language for organizing code. The object model is poorly designed and tacked on, to the point that almost no one uses it. Function notation is antiquated -- no support for simple things like optional arguments or default argument values, so you had mess around with magic variables called `varargin` and `nargin`. Matrices and cell arrays are the central data structures, and while these worked great for linear algebra, they are terrible for anything that required a true tabular multitype data structure, i.e. a Dataframe.
It wasn't until only a few years ago that the Table data structure entered the picture (the Statistics Toolbox had a Dataset data structure previously, which was a simplified Table, now deprecated), but by then a lot of very messy code based on cell-arrays had been written. Cell arrays are a terrible hack and easily one of the most inconsistent array types I've ever seen. (the slicing notation gave you unintuitive results depending on how you wrote it)
And, to productionize MATLAB code, you had to buy a $5000 (back in the day) MATLAB "compiler" which packaged your code to be run by a Runtime. You could get around this by running your MATLAB IDE in headless mode on the server, but it's heavy and you'd be consuming one MATLAB license per program.
For many years in the late 2000s, numpy/scipy were still immature and we couldn't move off Matlab, but about 10 years ago, numpy/scipy and pandas became sufficiently mature that we could transition off MATLAB and so we did. Suddenly our code, performance, deployment process, and interop with other parts of the system got a lot better -- just by moving off MATLAB to a real language like Python.
I don't be begrudge people who still use Matlab for research work. But my experience is that it's not the platform you want to be on when you need to productionize your code. Python is just a lot better. Or Julia -- whose syntax looks like it's partly inspired by Matlab (there's a striking similarity down to 1-based indexing), though without any of Matlab's inherent language design weaknesses or deployment difficulties.
- noobermin 6y agoSmall tidbit, I'm guessing it might more likely be the case that Julia is inspired by Fortran, and Fortran inspired matlab, not the other way around. That said, as someone who used python (got my phd just a few years ago so I'm younger) while the rest of my cohort used matlab because their professors used it, I am happy now that I never have to worry about licensing or running things on my own PC, and yes, it's an actual programming language and an actual platform for development so, it's definitely easier for me now that I'm actually working. Also, thankfully scipy gives me a .mat reader so I still can send and receive data from colleagues.
- wenc 6y agoI believe you're right -- I'm misremembering from the early days when Julia came out and folks on various forums were remarking how similar its syntax was to Matlab, likening it to a faster compiled Matlab.