Clean Timetable with Missing, Duplicate, or Nonuniform
Times
This example shows how to create a regular timetable from one that has missing,
duplicate, or nonuniform times. A timetable is a type of table that associates a time-
stamp, or row time, with each row of data. In a regular timetable, the row times are
sorted and unique, and differ by the same regular time step. The example also shows how
to export the data from a timetable for use with other functions.
Timetables can be irregular. They can contain rows that are not sorted by their row times.
Timetables can contain multiple rows with the same row time, though the rows can have
different data values. Even when row times are sorted and unique, they can differ by time
steps of different sizes. Timetables can even contain NaT or NaN values to indicate
missing row times.
Timetables provide a number of different ways to resolve missing, duplicate, or
nonuniform times, and to resample or aggregate data to regular row times.
- To find missing row times, use ismissing.
- To remove missing times and data, use rmmissing.
- To sort a timetable by its row times, use sortrows.
- To make a timetable with unique and sorted row times, use unique and retime.
- To remove duplicate times, specify a unique time vector and use retime.
- To make a regular timetable, specify a regular time vector and use retime.
Clean Timetable with Missing, Duplicate, or Nonuniform Times