getsamples
Subset of timeseries
Description
Examples
Subset of timeseries
Create a timeseries
object tsout
that is a subset of the samples in the timeseries
object tsin
.
tsin = timeseries([10 20 30 40 50]',[0 5 10 15 20])
timeseries Common Properties: Name: 'unnamed' Time: [5x1 double] TimeInfo: tsdata.timemetadata Data: [5x1 double] DataInfo: tsdata.datametadata
tsout = getsamples(tsin,3:5)
timeseries Common Properties: Name: 'unnamed' Time: [3x1 double] TimeInfo: tsdata.timemetadata Data: [3x1 double] DataInfo: tsdata.datametadata
Display the sample times and data values in tsout
. The sample times in tsout
are the sample times in tsin.Time(3:5)
.
tsout.Time
ans = 3×1
10
15
20
tsout.Data
ans = 3×1
30
40
50
Input Arguments
tsin
— Input timeseries
scalar
Input timeseries
, specified as a scalar.
Data Types: timeseries
ind
— Row or column indices
scalar | vector
Row or column indices, specified as a positive integer numeric scalar or
vector. ind
represents column indices for column-oriented
data (ts.IsTimeFirst
is true
) and
represents row indices for row-oriented data
(ts.IsTimeFirst
is false
).
Data Types: double
| single
| int8
| int16
| int32
| int64
| uint8
| uint16
| uint32
| uint64
Version History
Introduced before R2006a
See Also
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)