A few things first: i is often used to increment for loops, but it is completly up to you if you use i, t or something else.
The for loop in Matlab will increment without adding t=t+1. Contrary while loops will not.
I cannot run your code, because i am missing H2bar, but my first advice would be to use proper indices. This means instead of x1, x2 x3.... use x(1), x(2), x(3). In your case x(:,1), x(:,2), x(:,3) since x is a vector.
I do not understand what you are trying to calculate, since your u values appear to be 0 (K0 is always 0) and you multiply a 2 element vector with a 2x2 matrix, but the loop you might be looking for should look somewhat like this: