timerange — Create a timetable row-time range selector object.
timerange(startTime, endTime) returns a row-time selector with Start, End, and Inclusivity properties.
Syntax
S = timerange(startTime, endTime, intervalType)Inputs
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
startTime | Any | Yes | — | Beginning of the selected row-time interval. |
endTime | Any | Yes | — | End of the selected row-time interval. |
intervalType | StringScalar | No | openright | One of openright, openleft, open, or closed. |
Returns
| Name | Type | Description |
|---|---|---|
S | Any | Timetable row-time subscript selector. |
How timerange works
- The optional third argument is
"openright","openleft","open", or"closed"; the default is"openright", which includes the start and excludes the end. - Datetime and duration bounds are the compatibility forms. Numeric bounds are available in
runmatcompatibility mode for timetables that use numeric row times. - Numeric integer bounds and numeric integer row times are ordered exactly without conversion to double.
- Datetime-unit and event-filter overloads are not yet implemented.
Example
Select A Half-Open Time Range
firstTime = datetime(2026, 7, 1);
lastTime = datetime(2026, 8, 1);
rows = timerange(firstTime, lastTime);
July = TT(rows, :)Expected output:
July contains rows at or after July 1 and before August 1Using timerange with coding agents
Open a RunMat example with live inputs, then ask the agent to explain how timerange changes the result.
Run a small timerange 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 · table2timetable · timetable · timetable2table · uitable · vartype · width
Open-source implementation
Unlike proprietary runtimes, every RunMat function is open-source. Read exactly how timerange is executed, line by line, in Rust.
- View the source for timerange 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.