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?
2 件のコメント
その他の回答 (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!