Amplitude envelope correlation script in MATLAB

The number of rows in the F matrix must match the number of elements in the channel file.
You need to edit the channel file as well.
https://neuroimage.usc.edu/brainstorm/Tutorials/ChannelFile#On_the_hard_drive
https://neuroimage.usc.edu/brainstorm/Tutorials/Scripting#File_structures
https://neuroimage.usc.edu/brainstorm/Tutorials/Connectivity#Additional_documentation