surj.singhania_1289 asked . 11/08/2019

How do I compare R, MATLAB and Python? What are their differences and relationships?

How do I compare R, MATLAB and Python? What are their differences and relationships?

Matlab

Expert Answer

Kshitij Singh ( Staff ) answered . 13/08/2019

It's very difficult to compare programming languages without knowing what you plan to do with them.

Python is a general purpose language, it's great for data structures and programming in general, it has a vast collection of libraries that you can use. Installing them sometimes is not very easy.

R is oriented to statistical analysis and data processing in small scale. It has a very huge collection of packages to do almost anything you might imagine with data and they are easy to install. As a general programming language it is much slower than python and the syntax is very confusing.

Matlab is commercial (fist huge difference) and oriented to mathematical processes, doing stuff with matrices and related things. It's very easy to program very complex things using Matlab as you have all the tools you need at your fingertips. Octave is a free version of Matlab and should be considered in the mix.

In terms of speed Matlab is slower than R and R is slower than Python.

In terms of abstraction Matlab > R > Python. So speed of code is the exact inverse of speed of coding

I'll resume my humble experience with these 3 languages:

  • If I need to test several different algorithms on some data I use R as it has packages for probably all of them and they are very easy to use.
  • If I need to use some data structures, specially hash tables or program things dealing with text and strings I use Python.
  • If I need to prototype a new algorithm I usually use Matlab.