systematicSample<T> function

List<T> systematicSample<T>(
  1. List<T> list,
  2. int step, {
  3. int start = 0,
})

Systematic sampling: take every step-th element starting at start.

Implementation

List<T> systematicSample<T>(List<T> list, int step, {int start = 0}) {
  if (step < 1) return [];
  final List<T> out = [];
  for (int i = start; i < list.length; i += step) {
    out.add(list[i]);
  }
  return out;
}