You don't necessarily need a loop for this. You can use B = diff(A) to return the differences between each pair of successive values of A, and then find(B > 1) to locate the ones that are larger than 1.
However, if you just wanted to know how to use a loop to do this, you could try
bad = ;
for j = 1:length(A)-1
d = A(j+1)-A(j);
if d > 1
bad = [bad j];
This would compile an array named 'bad' containing the location of all jumps in the value.