Moving average (variable kernel length) - MATLAB Cody - MATLAB Central

Problem 1344. Moving average (variable kernel length)

Difficulty:Rate

Find the moving average in a vector. The kernel length is a variable. For example

 x = 1:10
 kernel_length = 2 

would result in

 [ 1.5 2.5 3.5 4.5 5.5 6.5 7.5 8.5 9.5 ]

and

 x = 1:10
 kernel_length = 3 

would result in

 [ 2 3 4 5 6 7 8 9 ]

Solution Stats

43.79% Correct | 56.21% Incorrect
Last Solution submitted on May 07, 2025

Problem Comments

Solution Comments

Show comments
LLMs with MATLAB updated to support the latest OpenAI Models
Large Languge model with MATLAB, a free add-on that lets you access...
2
3

Problem Recent Solvers129

Suggested Problems

More from this Author9

Problem Tags

Community Treasure Hunt

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

Start Hunting!
Go to top of page