how i average n values in array
이전 댓글 표시
if i have data a and i want to mean or average every 10 values as 1:10, 2:11, 3:12 and as so on for length of data ?
채택된 답변
추가 답변 (2개)
Star Strider
2016년 8월 21일
‘But i need overlap between the values as 1:10 then from 2:11 and so on’
Use a moving average filter:
Heart_pulse_avg = filter(ones(1,10), 10, Heart_pulse);
댓글 수: 1
Steven Lord
2016년 8월 21일
Andrei Bobrov
2016년 8월 21일
a - your vector;
out = movsum(a,[0 9],'Endpoints','discard')/10;
카테고리
도움말 센터 및 File Exchange에서 Resizing and Reshaping Matrices에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!