Mathworks' Matlab vs Python over time

Compare 2019:

where they try to bash python as hard as possible

with now:

where they accept the current reality

2 Likes

Matlab is awesome. But you pay. Then you pay again. Next, more paying. Finally, you pay.

4 Likes

They not wrong (regarding Python, at least for some claims), even now, after taking that page down:

Matrix math in Python requires function calls, not natural operators, and you must keep track of the differences between scalars, 1-D arrays, and 2-D arrays.

Julia also has “natural operators”, yes, you need to know types (at least to use Julia well), but that’s a good thing (at least for long-term maintenance, and speed). I would like to see a kind of MATLAB-mode, where you can be more relaxed about some stuff (also, overflow-checks by default, like in Python, that’s already possible, and I might argue for it by default, in Julia 2.0…).

They should do: MATLAB vs Julia: Which one is right for you?" and “Julia and MATLAB” (makes less sense, or all three?), similar to their:

the right answer is often to use MATLAB and Python together

They quote people, from Reddit:

it’s certified. Results with MATLAB are trusted correct. […]
MATLAB costs $700 a year for all the toolboxes I use. That means my company has save a couple of hour of my labour before it pays for itself [all the toolboxes I use"

Yes, “almost as good” doesn’t make sense, but better (Julia) does.

Each tool has its own strengths and weaknesses.

After one university course in Fortran I did a minor amount of work in C. I have never used Python, nor OOP.

Then I learned MathCad. It is still my goto program if I want to solve handbook type of equations. It truly does format equations like pencil and paper, or the way equations look when properly formatted in Latex. Nothing else I have used comes close. And they have a trial version that continues to partially function after the trial period is over. I would use it if I didn’t have an old paid version. It does have its own idiosyncrasies though.

Then I needed to use Matlab because it was the only way I could access data that I had collected. It certainly has some nice functionality. And for interactive exploration of data, its figure tool is really nice. Being able to apply data tips interactively with the mouse and annotate interactively with the mouse is really valuable. Then their integrated GUI development tools help to build apps which I have dabbled with. I use Xmodal, developed by University of Cincinnati, using Matlab’s GUI and distributed using their runtime engine. It shows what can be done.

When we started exploring the possibility of doing remote data processing I looked for an open source alternative and found Julia. I really like the extra rigour imposed by making packages and the formalized testing of them. As a language it seems more logical in naming conventions. I also like the ability to write in a Matlab like high level syntax yet have the speed that comes with a low level language.

I look forward to the day when Matlab will add Julia to its comparison page!

1 Like

I was on a research team during my undergrad (2010-ish). My prof had inherited a Fortran77 code from his advisor that predicted flow around leading edges of airfoils. F77 is/was free, but doesn’t allow for dynamic sizing of variables. You want a finer mesh, you modify the source code and recompile. Also the code was limited to single CPU. We spent a lot of time teaching new students how to install Cygwin compilers, how to compile, etc.

I proposed rewriting the code in Matlab and was originally met with skepticism because “nothing is faster than Fortran” and “Matlab is expensive.” But I rewrote the code in Matlab and suddenly we had parallel-compute (via Matlab vectorization/ BLAS calls), it was super easy to change the mesh size dynamically, and I wrote a gui frontend that meant new students didn’t need to know coding. The Matlab code was ~10x faster than the Fortran code because of vectorization, and then Matlab added GPU compute and we got another 10x speedup.

Yes, Matlab cost our team $2k but that ended up being 100% worth it - though the prof’s advisor was an FOSS purist and didn’t like it. Suddenly our opportunity costs associated with our prof teaching students how to get F77 working, time spent re-compiling or waiting for solutions went waaay down.

4 Likes

Late remark here, but I have to add that it’s exactly the opposite. In Python (and Julia) the language keeps track of the difference between scalars/1D/2D/ND arrays for you, while in Matlab you must do it yourself with all sorts of isscalar/isvector etc. shenanigans, and make sure row/column vector orientation is in keeping with the convention you decide on. This is a pretty bad weakness of Matlab.

7 Likes

That is so much more horrifying than (compile-)time-to-first-anything, programming (including Fortran) has sure come a long way since the 70s.

1 Like