MATLAB Answers

How Create Pentad average

6 views (last 30 days)
MattyK
MattyK on 9 Jul 2019
Commented: Yash Totla on 9 Jul 2019
Good day.Is there a way to create pentad average in Matlab?. Thanks.

Accepted Answer

Yash Totla
Yash Totla on 9 Jul 2019
You can calculate the 5 point moving average using the MATLAB function movmean
pentadAvg = movmean(dataArray, 5)
  2 Comments
Yash Totla
Yash Totla on 9 Jul 2019
movmean will return the 5 day moving average
pentadAvg(3) = average(day1, day2, day3, day4, day5)
pentadAvg(4) = average(day2, day3, day4, day5, day6)
Are you expecting the following result instead
pentad(1) = average(day1, day2, day3, day4, day5)
pentad(2) = average(day6, day7, day8, day9, day10)

Sign in to comment.

More Answers (0)

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by