Then the elements of A and B appear alternating in the provided array:
C = [A, B].';
C(:)
Note that Matlab addresses the matrix in columnwise order.
With the original commandfprintf('%d %d\n',A,B); Matlab uses the format string to print all elements of A at first and then all of B, but not alternating.
Best Answer