Hacker News new | ask | show | jobs
by utdemir 4361 days ago
I'm just today converted a 300ish lines of Python computer vision-machine learning script to MATLAB. Mind that I'm a long time Python programmer(4+ years), and just used MATLAB once or twice.

But surprisingly, the resulting MATLAB code was fast, clean(cleaner than Python version) and also compatible with vast amaount of machine learning algorithms written in MATLAB(thats the very reason I had to switch to MATLAB).

I always thought that Python can do everything cleaner and more elegant, but I'm sad that in MATLAB, its easier and cleaner.

At least, now I don't need to import numpy, cv2, scipy, scikit-image, scikit-learn, pylab, matplotlib and ipython. Also, installing them was pretty hard too(specially scipy).

2 comments

There are certainly areas Matlab rocks, and some other that Python rocks. Because of the company support, Matlab has a large scientific community and is probably easier to install (Python has Anaconda and Sage, though).

However, there is one big (maybe a killing one) weakness of Matlab: it's proprietary. I used to work in a big company and need a Matlab license. The license costs 70k$, per year! It takes months to get the purchase approved. The biggest waste in choosing Matlab is the time to get it.

And because its proprietary, we'd have to KEEP buying for YEARS, otherwise our code won't run in the next project.

So we switched to Python in later projects, which does not require bureaucratic approval chains and provides code portability

GNU Octave is a basically identical language to MATLAB and, as the name suggests, is free. Identical to the point where most scripts will run using either platform without any issues or needing modification.

http://www.gnu.org/software/octave/

+1, must also mention oct2py, the Python to GNU Octave bridge, that runs m-files from python. Some matlab legacy m-files may be rescued in this way.

Sage and IPython are alternatives, too. http://www.sagemath.org/ http://ipython.org/

PS. I found these articles useful

Python vs Matlab http://www.pyzo.org/python_vs_matlab.html

10 Reasons Python Rocks for Research (And a Few Reasons it Doesn’t) http://www.stat.washington.edu/~hoytak/blog/whypython.html

Why Python is Better than Matlab for Scientific Software http://metarabbit.wordpress.com/2013/10/18/why-python-is-bet...