comparison functions/challange/convertEventListToEventRoll.m @ 0:2fadb31a9d55 tip

Import code by Vuegen et al
author Dan Stowell <dan.stowell@elec.qmul.ac.uk>
date Fri, 11 Oct 2013 12:02:43 +0100
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:2fadb31a9d55
1 function [eventRoll] = convertEventListToEventRoll(onset,offset,classNames)
2
3
4 % Initialize
5 eventRoll = zeros(ceil(offset(length(offset))*100),16);
6 eventID = {'alert','clearthroat','cough','doorslam','drawer','keyboard','keys',...
7 'doorknock','laughter','mouse','pageturn','pendrop','phone','printer','speech','switch'};
8
9
10 % Fill-in eventRoll
11 for i=1:length(onset)
12
13 pos = strmatch(classNames{i}, eventID);
14
15 eventRoll(floor(onset(i)*100):ceil(offset(i)*100),pos) = 1;
16
17 end;