MATLAB: New line

lk

So i want to write information in a text file annd this is my code
fid=fopen('simulation.txt', 'a');
fprintf(fid,'\n');
fprintf(fid,'%s\n ','injection moulding ');
fprintf(fid,'% g\n ',y);
fprintf(fid,'% g\n ',x);
fprintf(fid,'\n');
fclose(fid);
however it is not skipping a line between each one. what am i doing wrong?

Best Answer

You might try using 'at' instead of 'a' when you fopen().