Home > data-analysis > stats > event > get_overlapped_proportion_among_three_events.m

get_overlapped_proportion_among_three_events

PURPOSE ^

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

SYNOPSIS ^

function sum_event_duration = get_overlapped_proportion_among_three_events(indic1, indic2, indic3)

DESCRIPTION ^

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 Get the proportion of overlappaed part with three events
 Input: Three events (head, hand, and eye timestamps) :: (event start time, event end time)
 Output: Sum of overlapped event duration
 Author: Seehyun Kim
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0002 % Get the proportion of overlappaed part with three events
0003 % Input: Three events (head, hand, and eye timestamps) :: (event start time, event end time)
0004 % Output: Sum of overlapped event duration
0005 % Author: Seehyun Kim
0006 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0007 
0008 function sum_event_duration = get_overlapped_proportion_among_three_events(indic1, indic2, indic3)
0009 
0010 first_overlapped_event_part = event_AND(indic1, indic2);
0011 total_overlapped_event_part = event_AND(first_overlapped_event_part, indic3);
0012 
0013 duration = zeros(1,1);
0014 sum_event_duration = 0;
0015 
0016 if total_overlapped_event_part == 0
0017     sum_event_duration = 0;
0018 else
0019     for j = 1:size(total_overlapped_event_part,1)
0020         duration(j,1) = total_overlapped_event_part(j,2) - total_overlapped_event_part(j,1);
0021         sum_event_duration = sum_event_duration + total_overlapped_event_part(j,2) - total_overlapped_event_part(j,1);
0022     end
0023 end

Generated on Tue 23-May-2017 03:00:58 by m2html © 2005