I am using MATLAB. I have a question about how i can verify that the values of a matrix are being repeating, like this:
A=[ 2 3 2 3 2 3 2 3]
If
I would like to throw in another approach. As I see when you are asking for "repetion" so maybe you want to have the same "pattern" repeated. For this it's easy to abuse the string functions.
A=[1,2,3,4,1,2,3,4,1,2,3]
position_repetition = strfind(A,A(1:2))
I suppose you could use regexp
for more complicated pattern. Like this would check for the longest pattern that is repeated:
tmp = regexp(char(A),'(?.+)\1+','names')
group = double(tmp.group)
this should be as I understand the question - it checks if it is a repetion of the first two entries:
A=[1,2,3,4,1,2,3,4,1,2,3,4]
tmp = regexp(char(A),'^(?..)\1+$','names')
AUX = ~isempty(tmp)