1 What Is MATLAB and Why Use It? 5
that your code runs in Octave. If you do the kinds of off-line data analyses
where you can start the script at night and look at the results the next
morning or the next week, then the slight decrease in computation time is
not prohibitive, and using Octave will free up MATLAB licenses.
All of the code in this book was tested in Octave. Occasionally, the
Octave code looks slightly different than the MATLAB code or the MATLAB
code does not work in Octave; this is noted in the code. Because nearly
everything in this book can be implemented in Octave with little or no
modification, the term “MATLAB” for the rest of this book really means
“MATLAB and probably also Octave.”
1.3 Python, Julia, C, R, SPSS, HTML, and So Forth
In terms of neuroscience data analysis, there really is no viable alternative
to MATLAB. True, many or perhaps all of what can be accomplished in
MATLAB can be accomplished in Python or C++ or Julia or several other
programming languages, but this does not make them viable alternatives.
For one thing, despite some hype about other languages, MATLAB remains
a dominant language for data analysis in psychology, neuroscience, cogni-
tive neuroscience, and many other branches of science. In part this is
because MATLAB is specifically designed to work with multidimensional
matrices, and neuroscience data nearly always reside in matrix form.
To be clear, there is nothing wrong with these other programming
languages. There will be situations where other languages are superior to
MATLAB and should be used. R and SPSS, for example, are well suited for
analyses of multifactor parametric statistical models such as mixed-effects
linear modeling. Python is arguably better than MATLAB at searching
through online text databases to locate specific entries and associate them
with information from other databases. C is generally much faster than
MATLAB. But within the context of neuroscience data analysis, these are
the exceptions. By far, the majority of neuroscience data analyses are done
in MATLAB.
In practice, you will use several programming languages in your scien-
tific career. It would behoove you to gain some familiarity with other lan-
guages, but if the topics listed in the table of contents of this book fit the
description of the kinds of analyses you will be doing, MATLAB is the best
option. For example, in addition to MATLAB, I occasionally use R, SPSS,
Python, Presentation, and hoc, but I use these relatively infrequently and
am no expert in these other languages.