MATLAB: Add an empty line in the text file

empty lineinsert

hi there, I'm writing this program where the results are writtten to a text file. i am using: dlmwrite('test.txt',mat, '-append','delimiter','\t','newline','pc')
text file looks like:
2
3
4
6
but i want to add an empty line in between each results. looking like:
2
3
4
6
how do i do that?…please help. thanks in advance.
cheers SN

Best Answer

use fprintf()
fid=fopen('test.txt','wt');
fprintf(fid,'%d\n\n',mat);
fclose(fid)