There are a numberr of ways to write your matrix, depending on what you want to do.
Since you want to use fprintf, if ‘M’ is your matrix:
fid = fopen( ...
fprintf(fid, [repmat('%10.5f\t', 1, size(M,2)) '\n'], M')
That should work. Experiment to get the result you want.