[ top | up ]

Processing Data in Segments

Syntax

[ntimes,nvals,nlabels] = hrsegment(times,vals,labels,startends,stat,params);

Arguments

times Column vector of the times of the data in vals.
vals The data
labels Column vector indicating the validity of the corresponding data point.
startends 2xN matrix giving the starting time and ending time of each segment. These values will be referenced to times to extract the segments.
stat The name of the statistic to calculate on the segment. This is specified as a quoted string, e.g., 'simpstat'
params A vector of parameters to be handed off to the statistic stat. See the documentation for each statistic for more information. To use the default values of the parameters, simply do not give this argument.

Returned Values

The interpretation of the returned variables depends on the particular statistic being used; see the documentation for that statistic for more details.
ntimes A matrix of the times of each segment, with one row for each segment. Typically this is the min and max time for that segment.
nvals The returned value of the statistic for that segment. There is one row for each segment.
labels A label for each segment. Typically this is the fraction of the data that was used by the statistic (e.g., the fraction of normal beats).

Description

hrsegment divides a data set into segments, and computes a specified statistic on each segment individually.

The list of segment times may be specified by hand, or by a program such as makesegs

Statistics written to be used by hrsegment must follow a specific convention. See segment statistic format.

References

See Also

Examples

% read in some data in the times/vals/labels format startends = makesegs( ); [t,v,labs] = hrsegment( times, vals, labels, startends, 'simpstat');