This 3D array is the correct output in this case. The first dimension of the array corresponds to the frames, the second dimension corresponds to each of the individuals, and the third dimension corresponds to the x, y coordinates. To transform this 3D variable into the text file, you can use the function trajectories2txt.m, which is included in idTracker's code (which you can download here:
https://github.com/idTracker/idTracker).