MATLAB爱好者论坛-LabFans.com

MATLAB爱好者论坛-LabFans.com (https://www.labfans.com/bbs/index.php)
-   资料存档 (https://www.labfans.com/bbs/forumdisplay.php?f=72)
-   -   MATLAB:计算时间序列每个1分钟间隔的平均值 (https://www.labfans.com/bbs/showthread.php?t=23152)

poster 2019-12-10 20:30

MATLAB:计算时间序列每个1分钟间隔的平均值
 
我有一堆时间序列,每个时间序列由两个部分描述,一个时间戳向量(以秒为单位)和一个测量值向量。时间向量不均匀(即以非规则间隔采样)

我正在尝试计算值的每1分钟间隔的平均值/ SD(采用X分钟间隔,计算其平均值,采用下一个间隔,...)。

我当前的实现使用循环。这是我到目前为止的样本:

t = (100:999)' + rand(900,1); %' non-uniform time x = 5*rand(900,1) + 10; % x(i) is the value at time t(i) interval = 1; % 1-min interval tt = ( floor(t(1)):interval*60:ceil(t(end)) )'; %' stopping points of each interval N = length(tt)-1; mu = zeros(N,1); sd = zeros(N,1); for i=1:N indices = ( tt(i)


所有时间均为北京时间。现在的时间是 05:02

Powered by vBulletin
版权所有 ©2000 - 2025,Jelsoft Enterprises Ltd.