MATLAB: How ‘movmedian’ in isoutlier work

isoutliermovmedian

Hi, I am using isoutlier 'movmedian' to remove outlier data. But i confused how that method. Anyone can explain?
Example: A= [1 2 1 -1 -2 -3 -1 3 4 1]
M=movmed(A,3)
M= 0.5 0 1 1 1 2 1 1 1,5
H=isoutlier(A,'movmedian',3)
H=0 1 0 0 0 0 0 0 0

Best Answer

According to the documentation ,
The 'movmedian' method "returns true for elements more than three local scaled MAD from the local median over a window length specified by window."
The MAD (mean absolute deviation) is explained here:
MAD is computed within a moving window across your data. You defined the window to be 3 elements long. Let me know if you need more help unpacking that.