<div dir="ltr"><div class="gmail_default" style="color:rgb(51,51,153)"><div class="gmail_default"><div class="gmail_default"><br></div><div class="gmail_default">Greetings Vishal, some more info to help you here, please be sure try it. Remember also to use eegh and to review the eeglab scripting tutorial.</div><div class="gmail_default">The example script below shows you the way to run ICA on one file at a time. Try it this way and it should work.</div><div class="gmail_default">If you haven't had a chance yet, just type eegh after you do the following, and review the eegh output</div><div class="gmail_default">1) loading a file, 2) running ICA on it, 3) save it with new file name, 4) clear eeglab of datasets </div><div class="gmail_default">You can cut and paste the below into matlab and run it after making a few modifications. </div><div class="gmail_default">I've named the variables so it's clear what info you need to put there when you change the code.</div><div class="gmail_default">Your best bet is to make one loop for one file, and show that it works. After that, run that on all your files.</div><div class="gmail_default"><br></div><div class="gmail_default"><br></div><div class="gmail_default">%%%%%%%%%%%%start your loop here</div><div class="gmail_default"><br></div><div class="gmail_default">for NUMBERofFilestoLoopThrough = 1: TotalNumberofFilesthatNeed_ICA</div><div class="gmail_default"><br></div><div class="gmail_default">NAMEofCURRENTfiletodoICAon = YourFileNameLIst(NUMBERofFilestoLoopThrough);   %%%%grab a specific .set filename</div><div class="gmail_default">NEWNAMEoffileWITH_ICA = [NAMEofCURRENTfiletodoICAon 'withICA']; %%%specify the new file name to save with after ICA<br></div><div class="gmail_default"><br></div><div class="gmail_default">ALLEEG EEG CURRENTSET ALLCOM] = eeglab;  %%%%%start eeglab</div><div class="gmail_default"><br></div><div class="gmail_default">EEG = pop_loadset('filename',NAMEofCURRENTfiletodoICAon ,cd);  %%%%%%%%%load the eeglab file</div><div class="gmail_default">[ALLEEG, EEG, CURRENTSET] = eeg_store( ALLEEG, EEG, 0 ); EEG = eeg_checkset( EEG );  %%%%update eeglab memory</div><div class="gmail_default"><br></div><div class="gmail_default">EEG = pop_runica(EEG, 'extended',1,'interupt','on');   %%%%%run ica</div><div class="gmail_default"><br></div><div class="gmail_default">[ALLEEG EEG] = eeg_store(ALLEEG, EEG, CURRENTSET); %%%%%update eeglab memory</div><div class="gmail_default"><br></div></div><div class="gmail_default">EEG = pop_saveset( EEG, 'filename',NEWNAMEoffileWITH_ICA ,'filepath',FilepathWhereYouwantTOstoreYourFileswithICA);  %%%save your dataset in your ICA folder<br></div><div class="gmail_default"><br></div><div class="gmail_default">[ALLEEG EEG] = eeg_store(ALLEEG, EEG, CURRENTSET); STUDY = []; CURRENTSTUDY = 0; ALLEEG = []; EEG=[]; CURRENTSET=[];  %empty eeglab memory</div><div class="gmail_default"><br></div><div class="gmail_default">end   %%%%%%%%%%%%%%%%%end of your loop here</div><div class="gmail_default"><br></div><div class="gmail_default"><br></div><div class="gmail_default"><br></div><div class="gmail_default"><br></div><div class="gmail_default"><br></div></div></div>