%% Moving Product of Matrix
% Compute the 3-point centered moving product for each row of a matrix. The dimension argument is 2, which slides the window across the columns of A. The window starts on the first row, slides horizontally to the end of the row, then moves to the second row, and so on.

A = [1 2 1; -1 -2 -3; -1 3 4]

%

M = movprod(A,3,2)

% Copyright 2012 The MathWorks, Inc.