getsamples
timeseries
的子集
说明
示例
timeseries
的子集
创建一个 timeseries
对象 tsout
,它是 timeseries
对象 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
在 tsout
中显示样本时间和数据值。tsout
中的样本时间是 tsin.Time(3:5)
中的样本时间。
tsout.Time
ans = 3×1
10
15
20
tsout.Data
ans = 3×1
30
40
50
输入参数
tsin
— 输入 timeseries
标量
输入 timeseries
,指定为标量。
数据类型: timeseries
ind
— 行或列索引
标量 | 向量
行或列索引,指定为正整数数值标量或向量。ind
表示列向数据的列索引(ts.IsTimeFirst
为 true
时)或行向数据的行索引(ts.IsTimeFirst
为 false
时)。
数据类型: double
| single
| int8
| int16
| int32
| int64
| uint8
| uint16
| uint32
| uint64
版本历史记录
在 R2006a 之前推出
另请参阅
MATLAB 命令
您点击的链接对应于以下 MATLAB 命令:
请在 MATLAB 命令行窗口中直接输入以执行命令。Web 浏览器不支持 MATLAB 命令。
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)