MATLAB: Function for Calculating Moving sum moving sum Is there any function to calculate moving sum of a vector? I use "smooth" for calculating the moving average of a vector Best Answer For a "moving" sum - the sum in a window - you can use conv(), or conv2() in two dimensions:windowWidth = 15; % or whatever.movingSum = conv(oneDsignal, ones(1, windowWidth));for the moving average:windowWidth = 15; % or whatever.movingAverage = conv(oneDsignal, ones(1, windowWidth) / windowWidth); Related SolutionsMATLAB: Moving average of array If you have R2016a or later, use the movmean (link) function. Otherwise, see the filter (link) documentation section on Moving Average Filter (link). MATLAB: Is there any function like movstd in R2015 conv() or filter() can be used for moving average. Related Question
Best Answer