Basics of Managing Time-Stamped Data - MATLAB
Video Player is loading.
Current Time 0:00
Duration 3:01
Loaded: 5.43%
Stream Type LIVE
Remaining Time 3:01
 
1x
  • Chapters
  • descriptions off, selected
  • en (Main), selected
    Video length is 3:01

    Basics of Managing Time-Stamped Data

    Learn how to use timetables in MATLAB to work with time-stamped tabular data, including datetimes and durations, to analyze and present your data.

    For more information about date and time data types, including datetime, duration, and calendarduration, check out this video, Working with Dates and Times in MATLAB.

    For further learning on preprocessing and advanced analysis of timetables, check out this video, Advanced Usage of Timetables.

    Published: 13 Sep 2016

    Hello, and welcome back to another MATLAB video. Today, we're talking about the basics of using a timetable to manage time-stamped tabular data in MATLAB. This is a vital skill for anyone who wants to work with time-stamped real-world data and wants to process it for useful analysis and presentation.

    Timetables are useful for any data table containing date and time information. The three data types MATLAB has for such information are datetime, duration, and calendar duration. To hear more about these data types, check out the video Working With Dates and Times in MATLAB, linked in the description.

    Let's get into the nuts and bolts of how to effectively use timetables. After inputting a table containing time data into MATLAB, the function table2timetable turns this mixed-type data table into a time table, with the time data becoming metadata, meaning that each row of the non-time data is now labeled with a time. This time data can be datetimes or durations. Additionally, the timetable function can be used to make a timetable from raw data.

    Once you construct a timetable, it's time to look at the data it contains. You can access subsets of a timetable through selecting rows and columns with subscripting. This can be through calling data and specific table rows and columns, specific variable names, or in specific time ranges. The syntax used for this subscripting affects the output, with smooth parentheses returning a table that has selected rows and variables, dot notation returning the contents of a variable as an array, and curly braces returning an array concatenated from the contents of selected rows and variables.

    The timerange function can also be used to call timetable data and specific time ranges, both in closed and half-open intervals. Once you've accessed the data inside a timetable, you can perform actions on it, like plotting. You can plot the data in a timetable like plotting any array. And by using the selection methods mentioned earlier, you can plot the exact timestamp data you need, with the axes autoformatted to properly visualize your timestamp data.

    In addition to accessing and analyzing a timetable, you can also preprocess the data it contains for more effective analysis. For example, the sortrows function allows you to sort the table by the time metadata, if you're looking to clean up your timetable before analyzing it. Many other functions help you clean up and organize data, as well as create ways to better analyze and present timestamp data.

    Check out the advanced timetables video for more on these pre-processing techniques, as well as other useful tips and tricks for working with timetables For more exploration about timetables in general, search the MATLAB documentation for timetable. In this video, we have discussed the ins and outs of timetables in MATLAB. Now that we have a better understanding of how to use timetables to better organize and process timestamp data, you can produce more intuitive directed results using your timedata analysis. Thanks for watching, and I'll see you guys in another video.

    Related Products

    View more related videos