moving sum
m =movsum(
returns an array of local一个
,,,,k
)k
-point sums, where each sum is calculated over a sliding window of lengthk
across neighboring elements of一个
。什么时候k
is odd, the window is centered about the element in the current position. Whenk
甚至,窗口集中当前呢and previous elements. The window size is automatically truncated at the endpoints when there are not enough elements to fill the window. When the window is truncated, the sum is taken over only the elements that fill the window.m
is the same size as一个
。
如果一个
是一个向量,然后movsum
operates along the length of the vector.
如果一个
is a multidimensional array, thenmovsum
operates along the first array dimension whose size does not equal 1.
m =movsum(___,,,,
returns the array of sliding sums along dimension暗淡
)暗淡
对于以前的任何语法。例如,如果一个
is a matrix, thenmovsum(a,k,2)
operates along the columns of一个
,,,,computing thek
- 每行的元素滑动总和。
m =movsum(___,,,,
specifies whether to include or omitnanflag
)南
来自任何先前语法的计算值。movsum(A,k,'includenan')
包括全部南
values in the calculation whilemovsum(a,k,'omitnan')
ignores them and computes the sum over fewer points.