file_name ='data.txt';
fid = fopen(file_name, 'w');
fprintf(fid, '%.17e%+.17ei\r\n', [real(data.'); imag(data.')]);
fclose(fid)
I deliberately did not put a space between the real and imaginary parts: some parsing software can only detect the imaginary part as being part of the same number if there is no space. You can put a space before %+ if you want.
If you need a space after the sign for the complex part, then that would need more work.