How to assemble time series by smaller time series (or windows)
2 views (last 30 days)
Show older comments
Hi, I have a time series of about 18 minutes containing vector of data and time vector. Both of the 2 vectors are the same length and they correspond to each other. Like x and y in plotting. My goal is to be able to "separate" this time vector in a desired span window. Here is an example:
%F = 120 values of data
%T = 120 values of time vector (in seconds)
% I would like to have windows of 30 seconds each, containing F data.
% So the first window would be the first 30 seconds of T with corresponding F data. The second window
% would be the next 30 seconds of T with corresponding F data and so on.
I think I should use the indices of the timevector to do that.
Any idea? Thank you
Adam
0 Comments
Answers (1)
Ced
on 28 Mar 2016
Edited: Ced
on 28 Mar 2016
Could you specificy what you want in the end? A timeseries object? A separate data matrix for each case?
If you want to concatenate data saved in different windows, you can use addsample ( or just concatenate the data before creating the object ). If you have the full time vector, but only want to have a look at a particular time window, you can use getsamples for the timeseries (sub)object, and getdatasamples for an array with the (sub)data.
You can find a list of the available methods at the bottom of
0 Comments
See Also
Categories
Find more on Time Series in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!