How to get mean value minute by minute in a vector.
1 次查看(过去 30 天)
显示 更早的评论
Hi, I have vector of 21422x1and I want to be able to get mean value every 60 second. Is there any way to do this? I also have t2 time variable length 21433.
(sample was taken at 1Hz)
I could get the mean value in excel it self but do not know how I can get the time variable, how to identify the each 60 second ?
Thanks in Advance.
0 个评论
采纳的回答
darova
2019-5-19
If the frequency is 1Hz then:
k = 1; % counter of mean value vector
n = length(v); % length of original data vector
m = 60*1; % every 60th values at 1Hz frequency
v1 = zeros( fix(n/m),1 ); % vector with mean values
for i = 1:m:n
v1(k) = mean( v(i:i+m) );
k = k + 1;
end
Any questions?
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Data Import from MATLAB 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!