how to get hours of recorded data to 10 minutes time averaged data by moving averaging
조회 수: 4 (최근 30일)
이전 댓글 표시
Hi
I have hours of data recorded. I want them to avrage for 10 minutes by moving avraging. How I can do that ?
Here I am doing correlation with hours of recoreded data. I want to use time avraged data for correlation. Here in this case A and S have hours of data and I want to avrage them in 10 minutes before calculating correlation:
L = length(A) - 300;
B = zeros(L, 1);
for i = 1 : L
cc = corrcoef(A(i:i+300), S(i:i+300))
B(i) = cc(2,1);
end
plot(B);
Any help would be appriciable.
댓글 수: 0
채택된 답변
Peter Perkins
2019년 4월 16일
It's not clear to me exactly what you want to do, but the following computes 10-minute binned means of timestamped data.
>> tt = timetable(rand(100,1),'RowTimes',seconds(1:100:10000));
>> head(tt)
ans =
8×1 timetable
Time Var1
_______ _________
1 sec 0.28029
101 sec 0.81593
201 sec 0.37191
301 sec 0.6861
401 sec 0.31017
501 sec 0.0093475
601 sec 0.1038
701 sec 0.52096
>> ttAvg10 = retime(tt,'regular','mean','TimeStep',minutes(10));
>> head(ttAvg10)
ans =
8×1 timetable
Time Var1
________ _______
0 sec 0.41229
600 sec 0.29121
1200 sec 0.3611
1800 sec 0.48868
2400 sec 0.52948
3000 sec 0.38843
3600 sec 0.51433
4200 sec 0.40669
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 National Instruments Frame Grabbers에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!