Extract one-dimensional timeseries from multidimensional timeseries

4 次查看(过去 30 天)
Hey,
I have a timeseries with Time: [nx1] and Data: [3x1xn] (output from a Simulink model)
How can I get a timeseries based on one dimension of the data? Can I somehow index it?
For example:
ts_3D = timeseries([1; 2; 3].*ones(3,100), linspace(1,100,100))
Now I want to do something like:
ts_1D = ts_3D(1,:)

回答(1 个)

Satwik
Satwik 2023-6-14
Yes, you can index the data in a timeseries in MATLAB, including selecting a single dimension of the data.
ts_3D = timeseries([1; 2; 3].*ones(3,100), linspace(1,100,100));
ts_1D = timeseries(ts_3D,1:100)
timeseries Common Properties: Name: 'unnamed' Time: [100x1 double] TimeInfo: tsdata.timemetadata Data: [100x1 timeseries] DataInfo: tsdata.datametadata

类别

Help CenterFile Exchange 中查找有关 Time Series 的更多信息

标签

产品


版本

R2021a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by