open-discussion > RE: Octave vs Matlab vs Pythonfor Neuroimaging research
Sep 18, 2018  02:09 PM | Troy Smith - University of North Georgia
RE: Octave vs Matlab vs Pythonfor Neuroimaging research
I am a former Matlab user who has migrated to Python whenever possible, so I guess you could call me a Python enthusiast.  I agree that there are a few downsides to Python, but I think these are vastly outweighed by the advantages.  With regard to the points raised by Arnaud Delorme:
  • Yes, getting used to 0-based indexing is not intuitive and can be challenging. This is probably one of the most difficult aspects of Python for non-programmers and novices.  However, the fact that vectors/arrays are 0-based makes the code much easier to write and read, particularly when slicing.  
  • I agree that indenting has issues, particularly when copying and pasting. However, it also makes reading and troubleshooting much, much easier. That's one reason I was taught even in my C++ and Matlab training to use indentation.  The fact that Python forces you to indent has saved me from myself more times than I can count.
  • For interactive programming Matlab-style with Python, check out Spyder (https://www.spyder-ide.org/)
  • Yes, Python sometimes requires users to understand basic object-oriented concepts but these are not very difficult ones. IMHO, learning a few concepts is a small price to pay compared to the annual licensing fee for Matlab.
  • Library installation in Python is extremely easy if you use any of the common packages such as Anaconda or Enthought. On the other hand, I've had quite a few difficulties getting the path correct for external Matlab functions and packages.
  • Python 3 has been out for for almost 10 years now. All the major libraries, including numpy/scipy have been updated. If a novice programmer focuses on using Python 3 and ignores Python 2.7, they shouldn't run into any of those issues. (Of course, it's likely that a number of labs still are using old code that may not be up-to-date, so this could be a problem for some.)
Another reason I choose Python is that I can use it for all kinds of tasks beyond neuroimaging. The text processing capabilities in Python are simply amazing, and I can use it to parse and manage log files from my EEG system and from behavioral experiment programs in ways that would be nearly impossible with Matlab. I even use Python for processing grades and other teaching-related responsibilities. Finally, I have found that Python is just easier for students to access and use (esp. when they are running scripts that other people have written) than is Matlab, especially when using Jupyter,

Best,
Troy

Threaded View

TitleAuthorDate
Arnaud Delorme Sep 10, 2018
Matthew Brett Sep 10, 2018
Arnaud Delorme Sep 17, 2018
RE: Octave vs Matlab vs Pythonfor Neuroimaging research
Troy Smith Sep 18, 2018
Matthew Brett Sep 18, 2018