有一组一维数组想要以​2000为窗口,窗口​移动步长为100计算​方差该如何实现?。

有一组一维数组想要以2000为窗口,窗口移动步长为100计算方差该如何实现?

 Accepted Answer

A=rand(1,3000);
ind=[1:100:length(A)-1999]+[0:1999]';
res=var(A(ind));

More Answers (0)

Categories

Find more on MATLAB in Help Center and File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!