Simple error. Your data_new(i)=randi([5,29],8,1)' is the problem. Try putting the line randi([5,29],8,1) ' into the command window and see what happens. You're wanting to assign a single value into data_new but your code tries to assign an entire vector, hence the error.
Try this line instead (change the 8 to a 1):
As side note, MATLAB will provide you with a warning saying that data_new will change size each iteration. Whilst it may not make much difference with such a small vector, with larger datasets this can cause issues with making the code run much slower. Wherever possible, it is good practice to pre-initiaalise the vector before the loop. For numeric matrices I personally like to create an 'empty' matrix of NaN values before loops like yours. For example, I would write the following into your script before the for loop, but after you create the existing_data variable:
data_new = NaN( size(existing_data) );