[Eeglablist] pop_rejmenu, pop_epoch
Ольга Протасенко
oprotasenko at mail.ru
Tue Apr 17 08:35:41 PDT 2012
Hello, Jason!
Thank you one more time for your answers.
The 3rd one is OK.
And I've tested some times the second (pop_epoch) and it generates an error:
--------------------------------------
??? Error using ==> pop_epoch at 226
pop_epoch(): empty epoch range (no epochs were found).
Error in ==> GUI_Finish3>btnokep_Callback at 103
EEG = pop_epoch( EEG2, { 16 }, [-1 2], 'newname', 'Epoch 16', 'epochinfo', 'yes');
Error in ==> gui_mainfcn at 96
feval(varargin{:});
Error in ==> GUI_Finish3 at 42
gui_mainfcn(gui_State, varargin{:});
Error in ==> @(hObject,eventdata)GUI_Finish3('btnokep_Callback',hObject,eventdata,guidata(hObject))
??? Error while evaluating uicontrol Callback
---------------------------------------
My code is:
(for Radiobutton of this 16th epoch):
-------------------------------------------------
function ep16_Callback(hObject, eventdata, handles)
global epname epnumber EEG EEG2 newev num_events;
num_events = length(EEG.event);
newev = EEG.event;
for k = 1:(num_events-1)
if strcmp(newev(k).type,'2') && strcmp(newev(k+1).type,'8')
newev(k).type = '16';
end
end
EEG2 = EEG;
EEG2.event = newev;
epname = 'Epoch 16';
epnumber = 16;
------------------------------------
(for the main button):
function btnokep_Callback(hObject, eventdata, handles)
global ALLEEG CURRENTSET EEG epname epnumber EEG2 newev num_events;
assignin('base','epname', epname);
assignin('base','epnumber', epnumber); % проверка
assignin('base','EEG2', EEG2);
if epnumber == 16
EEG = pop_epoch( EEG2, { 16 }, [-1 2], 'newname', 'Epoch 16', 'epochinfo', 'yes');
else
EEG = pop_epoch( EEG, { epnumber }, [-1 2], 'newname', epname, 'epochinfo', 'yes');
end
[ALLEEG EEG] = eeg_store(ALLEEG, EEG, CURRENTSET);
EEG = pop_rmbase( EEG, [-200 0]);
[ALLEEG EEG] = eeg_store(ALLEEG, EEG, CURRENTSET)
pop_rejmenu_for_GUI(EEG, 1);
---------------------------------------
Can you, please, find a mistake? For other types of epochs it runs ok.
More information about the eeglablist
mailing list