I notice that in your second for-loop you write
even though y = randfixedsum(4321,1,7200,0,7200) is set up to obtain a sum of only 7200. You will never correct for this mismatch with your for-loop procedure. You will probably end up with more than two thousand seconds too much for a sum in 'on'. I think you meant to write
If that isn't the source of the error I suggest you find the sums of both the x and y vectors when they are first created to see if these are as requested, with a reasonable allowance for round-off errors of course. If that checks out all right, then check your 'e' values as you emerge from each for-loop to see if at each of the two points it is exactly zero. I suspect one of these will uncover the error you are experiencing. If not, let us know.
Best Answer