seqperiod - Compute period of sequence

Syntax

p = seqperiod(x)
[p,num] = seqperiod(x)

Description

p = seqperiod(x) returns the integer p that corresponds to the period of the sequence in a vector x. The period p is computed as the minimum length of a subsequence x(1:p) of x that repeats itself continuously every p samples in x. The length of x does not have to be a multiple of p, so that an incomplete repetition is permitted at the end of x. If the sequence x is not periodic, then p = length(x).

[p,num] = seqperiod(x) also returns the number num of repetitions of x(1:p) in x. num might not be an integer.

Examples

x = [4 0 1 6; 
     2 0 2 7; 
     4 0 1 5; 
     2 0 5 6];
p = seqperiod(x)
p =
     2     1     4     3

The result implies:

  


 © 1984-2008- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS