Matrix with sliding window elements
问题 I have time series, and I applying some user defined function to every W elements in time series. Right now I am just using for loop, slide window of size W an apply my function to elements in a window at every iteration. I am using Matlab and it is very inefficient with a "for loops" so I would love to vectorize this operation. As a solution I see transforming signal with length N to a matrix with size (N - 1, W) where each row is time series in different windows and applying function to