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

event_average_dur

PURPOSE ^

Finds the average length of an event (or cevent)

SYNOPSIS ^

function [dur] = event_average_dur(cevent)

DESCRIPTION ^

 Finds the average length of an event (or cevent)  
 event_average_dur(EVENT_DATA)

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [dur] = event_average_dur(cevent)
0002 % Finds the average length of an event (or cevent)
0003 % event_average_dur(EVENT_DATA)
0004   
0005 if isempty(cevent)
0006     dur = NaN;
0007 else
0008     dur = mean(cevent(:,2) - cevent(:,1));
0009 end

Generated on Tue 23-May-2017 02:00:59 by m2html © 2005