Finding Pattern in Array of Values 1-64
2 次查看(过去 30 天)
显示 更早的评论
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 个评论
Star Strider
2020-6-20
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
2020-6-20
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.
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Creating and Concatenating Matrices 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!