x(j) is a single array element. You are trying to assign it 3 values, [dis0; phi0; theta0]. I'm unsure what the intent is, but one way to solve this is to specify row and column indices:
x(:,j)=[dis0; phi0; theta0];
You will need to double check everywhere you use x to take this change into account.