I wish to convert data from fieldtrip to eeglab using fieldtrip2eeglab function. My Data.trial is a cell array, and apply the follwing code, it gives me an error on line 17, "not enough arguments". Can anyone please help, to figure me out the error?
Show older comments
endfunction [EEG] = fieldtrip2eeglab(data)
[ALLEEG EEG CURRENTSET ALLCOM] = eeglab;
e
load chanlocs.mat
EEG.chanlocs = chanlocs;
%EEG.chanlocs = [];
for i=1:size(data.trial,2)
EEG.data(:,:,i) = single(data.trial{i}); % error here at line 17
end
EEG.setname = data.cfg.dataset;
EEG.filename = '';
EEG.filepath = '';
EEG.subject = '';
EEG.group = '';
EEG.condition = '';
EEG.session = [];
EEG.comments = 'preprocessed with fieldtrip';
EEG.nbchan = size(data.trial{1},1);
EEG.trials = size(data.trial,2);
EEG.pnts = size(data.trial{1},2);
EEG.srate = data.fsample;
EEG.xmin = data.time{1}(1);
EEG.xmax = data.time{1}(end);
EEG.times = data.time{1};
EEG.ref = []; %'common';
EEG.event = [];
EEG.epoch = [];
EEG.icawinv = [];
EEG.icasphere = [];
EEG.icaweights = [];
EEG.icaact = [];
EEG.saved = 'no';
[ALLEEG EEG CURRENTSET] = eeg_store(ALLEEG, EEG);
eeglab redraw
pop_eegplot( EEG, 1, 1, 1);
%%%%%%%%%%%%%%%% error msg %%%%%%%%%%%%%%%%%%%%%%%%%
eglab: options file is C:\Users\Differentielle 222\eeg_options.m
EEGLAB: adding "Biosig" to the path; subfolders (if any) might be missing from the path
EEGLAB: adding "bva-io" v1.5.13 (see >> help eegplugin_bva_io)
EEGLAB: adding "dipfit" v2.3 (see >> help eegplugin_dipfit)
EEGLAB: adding "firfilt" v1.6.2 (see >> help eegplugin_firfilt)
Error using fieldtrip2eeglab (line 17)
Not enough input arguments.
7 Comments
Bubblesjinx
on 24 Jun 2018
Jan
on 24 Jun 2018
Please post a copy of the complete error message. I cannot see which one is the "line 17".
Rik
on 25 Jun 2018
With 'complete error message' we mean all the red text, which almost always includes the entire stack of function calls, which gives a lot of information, including what code is on line 17. The text I'm assuming you added to your question was already in your title.
Bubblesjinx
on 26 Jun 2018
Rik
on 26 Jun 2018
If you attach the .mat file we might be able to help you.
Bubblesjinx
on 27 Jun 2018
Edited: Bubblesjinx
on 27 Jun 2018
Answers (0)
Categories
Find more on EEG/MEG/ECoG in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!