| Contents | Index |
Modify uniform time vector of timeseries object
ts2 = setuniformtime(ts1,'StartTime',StartTime)
ts2 = setuniformtime(ts1,'Interval',Interval)
ts2 = setuniformtime(ts1,'EndTime',EndTime)
ts2 = setuniformtime(ts1,'StartTime',StartTime,'Interval',Interval)
ts2 = setuniformtime(ts1,'StartTime',StartTime,'EndTime',EndTime)
ts2 = setuniformtime(ts1,'Interval',Interval,'EndTime',EndTime)
ts2 = setuniformtime(ts1,'StartTime',StartTime) returns the time series with a modified uniform time vector, determined from the StartTime and Interval 1. EndTime = StartTime + (length(ts1) - 1). The unit of time is unchanged.
ts2 = setuniformtime(ts1,'Interval',Interval) sets the StartTime to 0, and uses EndTime = (length(ts1) - 1)*Interval.
ts2 = setuniformtime(ts1,'EndTime',EndTime) sets the StartTime to 0, and uses Interval = EndTime/(length(ts1) -1).
ts2 = setuniformtime(ts1,'StartTime',StartTime,'Interval',Interval) uses EndTime = StartTime + (length(ts1) - 1) * Interval.
ts2 = setuniformtime(ts1,'StartTime',StartTime,'EndTime',EndTime)uses Interval = (EndTime - StartTime)/(length(ts1) - 1).
ts2 = setuniformtime(ts1,'Interval',Interval,'EndTime',EndTime) uses StartTime = EndTime - (length(ts1) - 1) * Interval.
ts2 |
Time series with uniform time vector, returned as a timeseries object. |
Modify the uniform time vector of time series data by specifying a new start time.
Load the sample data.
load count.dat;
Create a timeseries object.
count_ts = timeseries(count,1:length(count),'Name','CountPerSecond');
Modify uniform time vector of count_ts.
count_ts = setuniformtime(count_ts,'StartTime',10);
The start time of the time vector is 10 seconds. setuniformtime uses a default time interval of 1 and computes the end time using: EndTime = StartTime + (length(count_ts) - 1)* Interval.
Modify the uniform time vector of time series data by specifying a new start time and end time.
Load sample data.
load count.dat;
Create timeseries object.
count_ts = timeseries(count,1:length(count),'Name','CountPerSecond');
Assign a uniform time vector to count_ts.
count_ts2 = setuniformtime(count_ts,'StartTime',10,'EndTime',20);
The start time of the time vector is now 10 seconds, and the end time is now 20 seconds. MATLAB computes the time interval using: Interval = (EndTime - StartTime)/(length(count_ts) - 1)

Explore how to use MATLAB to make advancements in engineering and science.
| © 1984-2012- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |