%% Return Only Full-Window MADs
% Compute the three-point centered moving MAD of a row vector, but discard any calculation that uses fewer than three points from the output. In other words, return only the MADs computed from a full three-element window, discarding endpoint calculations.

A = [1 2 1 -1 -2 -3 -1 3 4 1];
M = movmad(A,3,'Endpoints','discard')

% Copyright 2012 The MathWorks, Inc.