Applied Event-Related Potential Data Analysis 2e · LibreTexts
0%
Contents
Text
Size
From LibreTexts, under CC BY-NC 4.0, as the source states it; its equations are written in TeX, which the PDF shows typeset. This page at LibreTexts.
3.13: Matlab Scripts For This Chapter
Opening the book…
I’ve provided two scripts in the data folder for this chapter. One is called load_erpsets.m, and it loads the 10 ERPsets into eStudio. The second is called preprocess_and_average.m, and it does the preprocessing and averaging for all 10 participants. The third is called postprocessing.m, and it carries out all the remaining steps in this chapter. These scripts are reasonably simple, and I’ve put lots of explanatory comments in them, so they’re a good way to start learning scripting. Give them a try!
Here's an important thing you need to know about running scripts: When you run scripts that alter the set of EEGsets or ERPsets loaded in memory, you won't see this reflected in the EEGsets and ERPsets panels in eStudio. This is because eStudio doesn't know that the EEG, ALLEEG, ERP, and ALLERP variables have been updated. However, if you click the Refresh button in the EEGsets or ERPsets panel, that panel will be updated to reflect the current contents of ALLEEG or ALLERP.
Let's test this out. Go to the ERP panel in eStudio, and clear any ERPsets currently loaded in the ERPsets panel. Now run the load_erpsets.m script (by loading the script and clicking the green Run arrow in the main Matlab GUI. That script will load the 10 ERPsets that are stored in the exercises folder for this chapter. You can tell that these 10 ERPsets are loaded by typing ALLERP in the Command window. But they don't show up in the ERPsets panel (because eStudio doesn't know that ALLERP has been updated). Click the Refresh button in the ERPsets panel, and you'll now see the ERPsets in this panel.