I wrote code that itterates element by element of the array 'nr'. Nr has 1000 random numbers. I want to display when two of those random numbers are of the same value, and adjacent. I think that works. I then tried to find the index of the value when it meets the condtion, but it doesnt work. I'm pretty stuck, does anyone have any tips?
for i = 1:length(nr)
fprintf("%d is adjacent to a number of equal value", i)
find(nr == i)
if i == 1000