%% Sequence Period Along Higher Dimension
% Create an array whose first two dimensions have size 1. Along the third dimension, the array has a repeating sequence.

a = permute([5 4 3 5 4 3 5 4],[3 1 2])

%
% Compute the period of the repeating sequence and the number of repetitions contained in the array. The function works along the third dimension, as expected.

[p,nr] = seqperiod(a)

% Copyright 2019 The MathWorks, Inc.