帮助中心帮助中心
访问 timeseries 数据样本
timeseries
tsdata = getdatasamples(ts,ind)
示例
注意
getdatasamples 函数应用于使用 timeseries 函数创建的对象。有关从 timetable(不推荐使用 timeseries 和 tscollection)获取数据的信息,请参阅在时间表中选择时间。
getdatasamples
timetable
tscollection
tsdata = getdatasamples(ts,ind) 返回对应于 ind 中索引的 timeseries 对象 ts 的数据。tsdata 中的数据对应于 ts.time(ind) 中的时间样本。
ts
ind
tsdata
ts.time(ind)
全部折叠
创建一个 timeseries 对象,并提取第二个和第三个数据样本。
ts = timeseries((1:5)'); tsdata = getdatasamples(ts,[2,3])
tsdata = 2×1 2 3
输入 timeseries,指定为标量。
数据类型: timeseries
行或列索引,指定为正整数数值标量或向量。ind 表示列向数据的列索引(ts.IsTimeFirst 为 true 时)或行向数据的行索引(ts.IsTimeFirst 为 false 时)。
ts.IsTimeFirst
true
false
数据类型: double | single | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64
double
single
int8
int16
int32
int64
uint8
uint16
uint32
uint64
在 R2006a 之前推出
timeseries | getsamples | resample
getsamples
resample
您点击的链接对应于以下 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:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Contact your local office