# Mathworks' Matlab vs Python over time

**URL:** <https://discourse.julialang.org/t/mathworks-matlab-vs-python-over-time/83612>\
**Category:** Offtopic\
**Created:** [July 1, 2022, 12:09pm UTC](https://discourse.julialang.org/t/mathworks-matlab-vs-python-over-time/83612 "2022-07-01T12:09:53Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![minetest2048](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/minetest2048/32/45961_2.png) [@minetest2048](https://discourse.julialang.org/u/minetest2048)\
**Post date:** [July 1, 2022, 12:09pm UTC](https://discourse.julialang.org/t/mathworks-matlab-vs-python-over-time/83612/1 "2022-07-01T12:09:53Z")

</div>

Compare 2019:

> **[MATLAB vs. Python: Top Reasons to Choose MATLAB](https://web.archive.org/web/20190724002932/https://www.mathworks.com/products/matlab/matlab-vs-python.html#comparison_table)**
>
> MATLAB vs. Python: Explore why engineers and scientists choose MATLAB over Python.

where they try to bash python as hard as possible

with now:

> **[MATLAB vs. Python: Which one is right for you?](https://au.mathworks.com/products/matlab/matlab-vs-python.html)**
>
> While most people start by asking whether they should choose MATLAB or Python, the right answer is often to use MATLAB and Python together.

where they accept the current reality

---

<div class="post-metadata">

**Author:** ![blackeneth](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/blackeneth/32/10353_2.png) [@blackeneth](https://discourse.julialang.org/u/blackeneth)\
**Post date:** [July 1, 2022, 2:22pm UTC](https://discourse.julialang.org/t/mathworks-matlab-vs-python-over-time/83612/2 "2022-07-01T14:22:18Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Palli](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/palli/32/3380_2.png) [@Palli](https://discourse.julialang.org/u/Palli)\
**Post date:** [July 1, 2022, 3:03pm UTC](https://discourse.julialang.org/t/mathworks-matlab-vs-python-over-time/83612/3 "2022-07-01T15:03:09Z")

</div>

> [@minetest2048](#):
>
> they try to bash python as hard as possible

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.

---

<div class="post-metadata">

**Author:** ![Jake](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jake/32/46007_2.png) [@Jake](https://discourse.julialang.org/u/Jake)\
**Post date:** [July 1, 2022, 3:16pm UTC](https://discourse.julialang.org/t/mathworks-matlab-vs-python-over-time/83612/4 "2022-07-01T15:16:24Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![GregVernon](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gregvernon/32/5611_2.png) [@GregVernon](https://discourse.julialang.org/u/GregVernon)\
**Post date:** [July 2, 2022, 12:27pm UTC](https://discourse.julialang.org/t/mathworks-matlab-vs-python-over-time/83612/5 "2022-07-02T12:27:49Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![DNF](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dnf/32/10191_2.png) [@DNF](https://discourse.julialang.org/u/DNF)\
**Post date:** [July 4, 2022, 8:51am UTC](https://discourse.julialang.org/t/mathworks-matlab-vs-python-over-time/83612/6 "2022-07-04T08:51:11Z")

</div>

> [@Palli](#):
>
> 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.

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.

---

<div class="post-metadata">

**Author:** ![Benny](https://avatars.discourse-cdn.com/v4/letter/b/49beb7/32.png) [@Benny](https://discourse.julialang.org/u/Benny)\
**Post date:** [July 4, 2022, 9:00am UTC](https://discourse.julialang.org/t/mathworks-matlab-vs-python-over-time/83612/7 "2022-07-04T09:00:25Z")

</div>

> [@GregVernon](#):
>
> You want a finer mesh, you modify the source code and recompile

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