Hello Amjad,
Is difficult to say which variable is exactly causing the problem since I am not able to simulate your code. However the error is telling you that you are trying to assign a vector to x_P_update that is not matching the dimensions of x_P_update. Your current implementation would work if x_P_update is a 1xn or a nx1 vector (and I guess this is not the case).
In case your x_P_update is something like a 3xn vector, the assignement should be at each n something like:
x_P_update(:,i) = A*x_P(i) + B*I(i)
And you also have to make sure that P(i) and B(i) are correct in dimensionality. Best way to see what happens is to debug the code by setting a debug point on the line causing the error.
Hope this helps,
Best,
Lorenzo
