In that case, I would suggest the code should look like this...
Originally Posted by Marine
Now, you are computing the vector valued function, x, at each time step. And then you are assigning each element of the vector to a particular column of the vector z.
I = [1 0; 0 1];
s_1 = [0 1; 1 0];
s_2 = [0 -1i; 1i 0];
s_3 = [1 0; 0 -1];
i = 0; % this starts a counter, which will allow to store data at each iteration of the for loop
for t = 0:0.1:10; %a for loop where t changes upon every iteration
i = i+1; % add 1 to the counter
x = (expm(cos(t).*I + 1i.*cos(t).*s_3) )*[1;2]; % store the vector-valued solution in cell 1 of the cell array x
z(i,1) = x(1);
z(i,2) = x(2);
end % end the for loop
Hence, at the end of the loop, your vector z will be a vector with 101 rows and 2 columns. The first column is one set of complex solutions at each time step, the second column is the other.
All that remains is to plot them, which is done as is shown in the code I've given.
If this is what you were looking for, let me know.