Finding Pattern in Array of Values 1-64

2 views (last 30 days)
William Collants
William Collants on 20 Jun 2020
Commented: Adam Danz on 20 Jun 2020
Hello World,
so I've this 1-D Array of about 100k Elements, Ranging in Value from 1 to 64. Plotting various Sections of the Array, the Order of Values does not seem to follow any discernable pattern, but I'd like to know that for sure. Plotting a histogram of the Array, for one, shows a highly non-uniform distribution of Values. Some, it looks like, do not occur at all.
What's the smartest way to go about this, to detect, if there be one, an underlying recursiveness, regularity, pattern, or function, according to which the numbers are arranged, or determine with certainty the absence of any regularity or pattern?
Kind Regards,
Tim
  3 Comments
Star Strider
Star Strider on 20 Jun 2020
I would experiment with xcorr, xcov, and their friends (such as findsignal) to see what they reveal:
x = zeros(1,100)+0.1;
x(20:28) = [1:5 4:-1:1];
x(60:68) = -[1:5 4:-1:1];
[r,lags] = xcov(x);
figure
subplot(2,1,1)
plot(x)
grid
subplot(2,1,2)
plot(lags, r)
grid
Here, the two are 40 index units apart, and of opposite signs, and that shows on the plot.
Adam Danz
Adam Danz on 20 Jun 2020
I was thinking along the lines of Star Strider's comment, too. You'd need to test many different window sizes but you may have a good estimate of the best window size by looking at the plotted raw data.

Sign in to comment.

Answers (0)

Categories

Find more on Creating and Concatenating Matrices in Help Center and File Exchange

Products


Release

R2019b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!