<div dir="ltr">Hi,<div><br></div><div>I am new to EEGLAB. I have an EEG data (.mat) that I can successfully import it in EEGLAB, use the last channel (#65) to load events and then save the data as a .set and .fdt pair. However, I have about 80 of these files and I would like to repeat these 3 processes to each of these files. I looked into doing it through GUI on the first file and then using the dataset history to get the commands for each step and applying to other files, but I am not quite sure how to do that.</div><div><br></div><div>By the way, I can manually import a bunch of files and then run the history commands to automatically perform the other two steps. So, the automatic import seems to be the limiting factor. I would ideally like the script to run through the directory and perform these steps on each file.</div><div><br></div><div>My command history for one dataset looks like this:</div><div><br></div><div>pop_read_gtec(ALLEEG) % importing function supplied by the vendor</div><div>EEG = eeg_checkset( EEG );</div><div>EEG = pop_chanevent(EEG, 65,'edge','leading','edgelen',0);</div><div>EEG = eeg_checkset( EEG );</div><div>EEG = pop_saveset( EEG, 'filename','S001_Oddball.set','filepath','C:\\Users\\Documents\\MATLABfiles\\EEG_Data\\Test\\');</div><div>EEG = eeg_checkset( EEG ); </div><div><br></div><div>Any and every help would be much appreciated.</div><div><br></div><div>Thanks and a happy new year!</div><div><br></div><div>-Muhammad </div></div>