**************************************************************************************** * Running ica.exe from the EEGLab GUI * * by Stefan Scherbaum (2006) * * Please report errors or problems to schtefan@tu-dresden.de * **************************************************************************************** To enable the use of binary ICA in eeglab/Matlab running under Windows, do the following: Step 1: Download ica.exe from the eeglab website (http://www.sccn.ucsd.edu/eeglab/) and store it somewhere in the scope of the matlab path and the system path Step 2: Modify icadefs.m Set the variable ICABINARY to "ica.exe" Step 3: Modify binica.m Replace this line (section "run binary ica", about line 333) eval_call = ['!' ICABINARY '<' pwd '/' scriptfile]; with these lines: % % - modified by Stefan Scherbaum, 2006 if(strcmp(computer,'PCWIN')) %find full path to enable start command to find ica.exe ICABINARY=which(ICABINARY); %generate path for batch script ICABAT=strrep(ICABINARY,'.exe','bat.bat'); %generate batch file fid = fopen(ICABAT,'wt'); fprintf(fid,'REM BATCHFILE FOR ICA.EXE, WRITTEN BY STEFAN SCHERBAUM\n'); fprintf(fid,'REM DO NOT CHANGE - CODE GENERATED BY MATLAB!\n\n'); fprintf(fid,'REM RUN ICA\n'); fprintf(fid,[strrep(ICABINARY,'\','\\'),' < %%1 \n']); fprintf(fid,'REM CLOSE CMD WINDOW TO SIGNAL END OF ICA TO MATLAB\n'); %fprintf(fid,'pause\n'); fprintf(fid,'exit\n'); fclose(fid); %use start to open new cmd window to show ica output % /wait lets matlab wait till cmd window closes after processing % /belownormal could be included to lower ica process priority to % continue doing other stuff in that machine eval_call=['!start /WAIT ' ICABAT ' ' pwd '/' scriptfile]; else % UNIX and other system standard call eval_call = ['!' ICABINARY '<' pwd '/' scriptfile]; end % Step 4: start binary ica via the GUI by selecting binica as method to run ICA