Problem 44844. Moving average
Solution Stats
Problem Comments
-
2 Comments
Rafael S.T. Vieira
on 1 Nov 2020
Tip: the x vector is useless, and the standard function movmean will not help since we have a window of variable size.
Christian Schröder
on 24 Nov 2022
The problem statement is not very clear, but what this problem is asking you to do is compute a moving average where the desired window size is w elements on either side, and where the window shrinks near the edges of the input vector (while staying symmetric) in order to avoid extending beyond the endpoints of said vector.
Also, as @Rafael observed, the vector x is unnecessary and can be ignored; you're only working with y (and w).
Solution Comments
Show commentsProblem Recent Solvers5
Suggested Problems
-
2454 Solvers
-
16692 Solvers
-
108 Solvers
-
Convert a vector into a number
580 Solvers
-
278 Solvers
More from this Author1
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!