table2timetable — Convert a table into a timetable.
table2timetable(T) converts a table to a timetable by selecting or supplying datetime or duration row times. Regular row times can instead be generated from SampleRate, TimeStep, and an optional StartTime.
Syntax
TT = table2timetable(T, Name=Value...)Inputs
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
T | Any | Yes | — | Input table. |
Name,Value | Any | Variadic | — | RowTimes, SampleRate, TimeStep, and StartTime options. |
Returns
| Name | Type | Description |
|---|---|---|
TT | Any | Output timetable. |
How table2timetable works
- Without timing options, the first datetime or duration table variable becomes row times and is removed from the data-variable list.
RowTimesaccepts a datetime or duration vector, a variable name, or a positive one-based numeric variable index. Typed-integer indices are decoded exactly in every supported integer class.- RunMat extension mode also accepts a numeric row-time column and preserves native integer storage exactly; MATLAB-compatible mode requires datetime or duration row-time values.
- A positive numeric
SampleRate, including any built-in integer class, generates duration row times through the documented floating timing boundary. - Integer data variables retain their exact classes and values independently of row-time construction.
- When no time variable or timing option exists, generated sequential row times are available only in RunMat extension mode. Converting table row names into a timetable data variable remains an implementation gap.
Examples
Converting With Explicit Row Times
times = seconds([1; 2]);
TT = table2timetable(T, RowTimes=times)Expected output:
TT = timetable objectSelecting A Time Variable By Index
TT = table2timetable(T, RowTimes=uint8(1))Expected output:
TT = timetable using the first datetime or duration variable as row timesUsing table2timetable with coding agents
Open a RunMat example with live inputs, then ask the agent to explain how table2timetable changes the result.
Run a small table2timetable example, explain the result, then change one input and compare the output.
Related Table functions
array2table · array2timetable · categorical · cell2table · dictionary · groupsummary · head · height · iscategorical · isordinal · istable · istimetable · ordinal · pivot · rowfilter · struct2table · table · table2array · table2cell · table2struct · timerange · timetable · timetable2table · uitable · vartype · width
Open-source implementation
Unlike proprietary runtimes, every RunMat function is open-source. Read exactly how table2timetable is executed, line by line, in Rust.
- View the source for table2timetable in Rust on GitHub
- Learn how the RunMat runtime works
- Found a bug? Open an issue with a minimal reproduction.
About RunMat
RunMat is an open-source runtime that executes MATLAB-syntax code blazing on any GPU. It is licensed under the Apache 2.0 license.
- RunMat automatically optimizes your math for GPU execution on Apple, Nvidia, and AMD hardware. No code changes needed. Simulations that took hours now take minutes.
- Start running code in seconds. RunMat runs in the browser, on the desktop, or from the CLI. No license server, no IT ticket.