The manuscript "Differences in EEG Spectral Power and Event-Related Potentials between Infant Quiet and Active Sleep" (under review) showcases this pipeline in 102 infants, and includes specific instructions and details in Methods and Supplemental Materials.
Supporting scripts: Reshaping.m splits the sleep-state spreadsheet into individual files for the main script. Run this before the main script and enter the output folder to the main script.
The main script calls Labeling_MMN.m during its processing.