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
Bubblesjinx
Bubblesjinx 2018년 6월 27일
편집: Bubblesjinx 2018년 6월 27일
Hi RIk, I have attached three matlab files. cued.m extract the EEG signal between 'S100' to 'S102' (S100 and S102 are the triggers supplied onset of stimuli to the time when participant started typing the answer). i am interested in the signal between these triggers. 1prepro_trudy.m preprocess the data and concatenate the trials. fieldtrip2eeglab is where I wish to convert the data format from fieldtrip to EEGLAB.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 EEG/MEG/ECoG에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by