Did you also assign X in advance? Why do you think there should be a t+1 element of X if you never assigned one?
n = 9;
A = rand(n, 3);
t = 4; % Whatever.
X(t) = A(t, 2); % Works fine
% The following won't work because X has only 4 elements, not 5
difference = X(t+1) - X(t); % There is no (t+1) element yet!
Not sure what you want to do Maybe you want this:
X = diff(A(:, 2);