Question: USE MATLAB! USE MATLAB! QUESTION 2: A moving average of a data set x = {x1, X2, X3, X4, X5,..., Xn-1, Xn } is defined
USE MATLAB!


USE MATLAB!
QUESTION 2: A moving average of a data set x = {x1, X2, X3, X4, X5,..., Xn-1, Xn } is defined as a set of averages of subsets of the original data set. For example, a moving average of every two terms would be ** {x1 + x2, x2 + x3, x3 + x4, x4 + X5,..., Xn-1 + xn}. Write a function that will receive a vector as an input argument, and will calculate and return the moving average of every two elements. The function will also output an error message if there are odd number of elements in the data set x
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
