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?
조회 수: 12 (최근 30일)
이전 댓글 표시
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
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 EEG/MEG/ECoG에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!