Cannot start eeglab - The file 'C:\EEGLab​\eeglab_cu​rrent\eegl​ab13_4_4b\​eeglab.m' could not be cleared because it contains MATLAB code that is currently executing.

7 views (last 30 days)
Hi, sorry if this already have been asked and answered.
I just installed the student version of MATLAB R2015b and it is running. I downloaded EEGLAB v13.4.4b and unziped to a folder on c:. The dicription how to run eeglab under matlab (EEGLAB-Tutorial) is quite old so I just browsed to the folder where the eeglab-file is at and doubbleclicked it. Then I startet it by pressing the play button in MATLAB and it started to execute. But it is not running, I get this errormessage instead:
>> eeglab
eeglab: options file is C:\Users\admin\eeg_options.m
EEGLAB: adding "Biosig" to the path; subfolders (if any) might be missing from the path
EEGLAB: adding "dipfit" v2.3 (see >> help eegplugin_dipfit)
EEGLAB: adding "firfilt" v1.6.1 (see >> help eegplugin_firfilt)
Warning: The file 'C:\EEGLab\eeglab_current\eeglab13_4_4b\eeglab.m' could not be cleared because it
contains MATLAB code that is currently executing.
> In eeglab>updatemenu (line 1398)
In eeglab (line 350)
In eeglab (line 1046)
If I browse to the folder and type "eeglab" into the command window I get the same error message (3 times).
What have I done wrong? Are you supporting problems with EEGLAB at all?
Sorry for my bad English and thank you in advance.
Marcus

Answers (4)

Walter Roberson
Walter Roberson on 11 Oct 2015
Somewhere in the updatemenu function of eeglab, near line 1398, something is calling "clear", probably "clear all". It might be a fault in the EEGLAB code, or possibly you accidentally have your own file named the same thing as one of the standard MATLAB routines and that is interfering with the execution.
You should open the source code for eeglab and put a breakpoint at line 1398 and execute to that point. Then use the debugger to single step until you find the "clear" that is being done, and figure out whether it is in the source of EEGLAB or if it is in one of your files.
EEGLAB requires registration to download, so I have not downloaded it to check the source. I do not have a "research area" and my use of the code would be for debugging it, not for the "neuroimaging research" that it is designed for, so it is not clear that I am eligible to use the code.
  2 Comments
Marcus Schroeter
Marcus Schroeter on 22 Oct 2015
Edited: Walter Roberson on 4 Feb 2016
Hello Walter, thank you for your answer.
Since I just started with Matlab because of EEGLAB and have no scripting backround I am a bit overwhelmed :-) I started with tutorials for Matlab and EEGLAB but it looks like it will take me weeks if not month to have a little bit of a plan. I will try what Steven recommended above and ask for their help in the mailinglist. But just in case you are interested, here is the code from line 1389-1402:
% test if the menu is present
try
figure(W_MAIN);
set_m = findobj( 'parent', W_MAIN, 'Label', 'Datasets');
catch, return; end;
index = 1;
indexmenu = 1;
MAX_SET = max(length( ALLEEG ), length(EEGMENU)-1);
line 1389 clear functions;
eeglab_options;
if isempty(ALLEEG) && ~isempty(EEG) && ~isempty(EEG.data)
ALLEEG = EEG;
end;
and here is the part surrounding line 350
% for the history function
% ------------------------
if nargin == 1
if strcmp(onearg, 'versions')
disp( [ 'EEGLAB v' eeg_getversion ] );
elseif strcmp(onearg, 'nogui')
if nargout < 1, clear ALLEEG; end; % do not return output var
return;
elseif strcmp(onearg, 'redraw')
if ~ismatlab,return; end;
W_MAIN = findobj('tag', 'EEGLAB');
if ~isempty(W_MAIN)
line 350 updatemenu;
if nargout < 1, clear ALLEEG; end; % do not return output var
return;
else
and so on
and the last one
% changing plugin menu color
% --------------------------
EEGMENU = uimenu( set_m, 'Label', '------', 'Enable', 'off');
eval('set(W_MAIN, ''userdat'', { EEGUSERDAT{1} EEGMENU javaobj });');
line 1046 eeglab('redraw');
if nargout < 1
clear ALLEEG;
end;
Thank you and best regards, Marcus

Sign in to comment.


Steven Lord
Steven Lord on 11 Oct 2015
EEGLAB is not a MathWorks product. You should contact the authors, check their documentation, or post to the mailing list they have on their website for help determining why this error occurs and how to avoid it.

Jussi Jaatinen
Jussi Jaatinen on 15 Oct 2015
Edited: Jussi Jaatinen on 15 Oct 2015
I added a % sign to the beginning of the line 1398 and voila! No error message any more.
I also fixed eeglab.m code with Matlab editor and now it seems to be ok.
I have exactly the same versions of SW´s.
Try also ERPLAB. It works well with 2015b and EEGLAB.
Jussi
  2 Comments
Marcus Schroeter
Marcus Schroeter on 22 Oct 2015
Hello Jussi, thank you ver much. As far as I understand the %-sign tells the programm that there is only informatinal text following and I am not sure if I should realy "deactivate" code this way. But as emntioned above...I have no clue. That leads to my next quesion to you. How did you fix eeglab.m code with the editor. Would you mind explaining what I would have to do?
I would love to "play" around with ERPLAB and other functions of EEGLB but right now I do not even get my data imported correctly. So I guess I have a long way to go and time is just running so quick :-) Are there any books, websites, videos that you can recommend for learning EEGLAB? Thank you and cheers, Marcus

Sign in to comment.


Yana Radchenko
Yana Radchenko on 4 Feb 2016
Edited: Walter Roberson on 4 Feb 2016
Had the same problem. And I am not Matlab professional, but that was helpful.
Added %clear functions;
The only catch for beginners it can be different lines.
Thanks!

Categories

Find more on Entering Commands in Help Center and File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!