Monday, April 30, 2018

Matlab and Python

I use Matlab/Octave, quite a bit, for pre- and post- processing. About 3-4 years ago, I started dabbling with python, and gradually began using it to handle increasing parts of my workflow.

Last week, I chanced upon this webpage at Mathworks, which tries to argue why Matlab is superior to python. Here are the key advantages:
  • The matrix-based MATLAB language lets you express math directly: This is definitely true. Even now, when my work predominantly involves linear algebra, I sometimes use Matlab/Octave. The notation is natural and concise. But this is Matrix Laboratory after all.
  • Engineers and scientists deserve tools that fit the way they work. They shouldn’t have to adapt the way they work to fit their tools: It is true that Matlab documentation feels like it was written with engineers and scientists in mind, while python documentation has a computer-sciency feel. But, the other reasons bundled under this heading don't seem like they apply to me.
  • Proven MATLAB toolboxes provide the functions and capabilities you need. Period.: However, many toolboxes are have to be bought separately. The standard scientific python stack is fairly mature at this point. Even the library overall landscape for python is richer for python in my mind. It reminds of this xkcd cartoon.
  • MATLAB apps let you complete tasks more easily than with custom programming
  • MATLAB helps automate the entire path – from research to production
  • You can trust the results you get in MATLAB: I lumped these three together, because for some reason, they are non-issues for me. I enjoy prototyping in python. If I am hardware limited, and I have to squeeze performance, then I usually code in C++ or Fortran.

  • MATLAB runs your programs faster – meaning you can try more ideas and solve bigger problems: This is probably true, but ignores the existence of JIT compilation (Numba) or integrating with C++/Fortran (Cython) etc.
Some of the advantages of python over Matlab are listed here, here, and here. If I had to make an intermediate term prediction (10 years), I think python will become more popular than Matlab, among scientists and engineers.

No comments: