%% Multichannel Signal Periods
% Generate a multichannel signal and determine the period of each column.

x = [4 0 1 6; 
     2 0 2 7; 
     4 0 1 5; 
     2 0 5 6];

p = seqperiod(x)

% The first column of x has period 2. The second column of x has period 1. The third column of x is not periodic, so p(3) is just the number of rows of x. The fourth column of x has period 3, although the second repetition of the periodic sequence is incomplete.
%
% Compute the number of times that each periodic sequence is repeated.

[~,nr] = seqperiod(x)

% In the first column of x, the periodic sequence appears twice. In the second column, the one-sample sequence is repeated as many times as there are samples. In the third column, there is no repetition. The number of repetitions in the fourth column is one plus the fraction of the sequence length represented by the remaining sample.
% Copyright 2012 The MathWorks, Inc.