www.gusucode.com > matlab 案例源码 matlab代码程序 > matlab/MovingVarianceWithWeightVectorExample.m

    %% Specify Normalization for Moving Variance
% Compute the three-point centered moving variance of a row vector and
% normalize each variance by the number of elements in the window.
A = [4 8 6 -1 -2 -3 -1 3 4 5];
M = movvar(A,3,1)