Skip to content

subsample.m

Basic Information

  SYNTAX:  [new_data,new_tvec]  = subsample(old_data, old_tvec, increment, k0)

  PURPOSE: Subsample data vector at increments of "increment", starting at
        sample k0.

  INPUT:
   old_data = data to subsample (if data is matrix, time corresp. to column)
   old_tvec = time vector corresponding to old_data
   increment = increment to subsample (can be a vector)
   k0   = sample numbers at which to start subsampling (optional, default=1)
     (data is returned only for samples >= k0(1) )

 EXAMPLE: If increment = [10 100], then k0 must exist and be the same size
 say, k0=[1 1000].  Then time and data vectors would be subsampled every
 10 samples between 1 and 1000 (i.e. 1, 11, 21, 31, ..., 991) and every
 100 samples thereafter until the end of the data.

  OUTPUT:
   new_data = subsampled data
   new_tvec = time vector corresponding to new_data

Dependencies