I don't really know what you are trying to do, but this statement:
Data=Data(1:p,i);
in your loop collapses your 200x10 matrix down to a vector that overwrites your original data, so that 2nd time round the loop (if indeed it even gets that far) you will get an error because i = 2, but Data is size (25,1)