Average of selected elements in Matlab

3 views (last 30 days)
I have a data file, first column is Month, second column is Demand. I want to calculate the Moving Average of month 4 (=(month 1+2+3)/3) and so on. Then, I want to display the results in the 3rd column. How can I do?
Instead of using Excel, I want to use Matlab to calculate this. Please help me :(((

Accepted Answer

weikang zhao
weikang zhao on 24 Dec 2020
Edited: weikang zhao on 24 Dec 2020
easy, use "conv"
the first element and the second element of 'x' are useless.
have fun
weikang zhao
weikang zhao on 24 Dec 2020
opps, 'x' is a column vector

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!

Translated by