Skip to content

Commit 2f40cf3

Browse files
authored
Merge pull request #244 from ReneSkukies/master
Update bids_writeeventfile.m
2 parents 106788b + 512b2ce commit 2f40cf3

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

bids_writeeventfile.m

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,11 @@ function bids_writeeventfile(EEG, fileOut, varargin)
172172
switch opt.eInfo{iField,1}
173173

174174
case 'onset'
175-
onset = (EEG.event(iEvent).(tmpField)-1)/EEG.srate;
175+
if strcmpi(tmpField, 'latency')
176+
onset = (EEG.event(iEvent).(tmpField)-1)/EEG.srate;
177+
elseif strcmpi(tmpField, 'onset')
178+
onset = EEG.event(iEvent).(tmpField);
179+
end
176180
str{end+1} = num2str(onset, 10);
177181

178182
case 'duration'

0 commit comments

Comments
 (0)