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

    %% Trailing Moving Standard Deviation of Vector
% Compute the three-point trailing moving standard deviation of a row
% vector.  When there are fewer than three elements in the window at the
% endpoints, take the standard deviation over the elements that
% are available.

A = [4 8 6 -1 -2 -3 -1 3 4 5];
M = movstd(A,[2 0])