%% X Is a Vector, Y Is a Matrix, and maxlag Is a Scalar
% maxlag is specified as a scalar (same maximum window sizes).

X = [0 1 2];
Y = [0 1 0 0;
     1 2 0 0;
     2 0 1 0;
     0 0 2 1];
maxlag = 3;
D = finddelay(X,Y,maxlag)

% Copyright 2015 The MathWorks, Inc.