hi: I met some problem when tried to write the first line to text file. below is what the base test file was.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/161383/image.jpeg)
I use the command:
fid = fopen('test.txt','r+')fprintf(fid,'%s\n','abc');fclose(fid)
but the result becomes like below:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/161384/image.jpeg)
the first number is deleted.but I could not find why.
could anyone give me some suggestions?
thanks! Li
Best Answer