11.2: Expected Background Knowledge
selected template will load here
This action is not available.
This chapter is designed for individuals all levels of prior experience, including people who have very little programming experience, people with substantial experience in other languages but little or no Matlab programming experience, and people who already know how to program in Matlab and just want to learn how to use EEGLAB and ERPLAB routines. I’m not actually a very experienced Matlab programmer myself, but I have a lot of experience with other languages.
Learning how to write scripts may seem daunting if you’ve never done any serious computer programming before. Fortunately, EEGLAB and ERPLAB have a history feature that make it fairly easy to write simple scripts for automating your analyses. Every time you run a routine from the GUI, the equivalent script command is saved in the history. To begin writing a script, you simply go through all the steps in the GUI, and then copy the commands from the history into a script file. You’ll usually need to make a few minor modifications to the commands, and then you need to add a little bit of general Matlab code so that your script can automatically loop through all your participants. But that’s the essence of creating automated EEGLAB/ERPLAB scripts. In fact, that’s exactly the process I used to create the example scripts for this book.
The scripts you’ll write to automate your EEGLAB/ERPLAB analyses will be pretty simple, but you do need to understand some basic programming concepts, especially variables , arrays , and loops . I’m not going to explain these concepts, so you will need to do a little preparation before starting this chapter. When someone without a lot of programming experience joins my lab, I typically have them take the online Introduction to Programming with MATLAB course offered on Coursera. Then, I have them work through a great book called Matlab for Behavioral Scientists (Rosenbaum et al., 2014). If you already have a lot of experience with other programming languages, but you haven’t programmed in Matlab, I recommend getting any of the books that provide a general introduction to Matlab so you can learn its specific syntax and its unusual but powerful approach to matrix operations.