How do I write a text file in the same format that it is read in MATLAB?
问题 I have asked a related question in the past and I know how to read the file thanks to the help of the experts here. Now I have a new problem. I first read the data from the file like so: fid = fopen('D:\file.txt', 'rt'); a = textscan(fid, '%s %f %f %f %f %f %f', ... 'Delimiter',',', 'CollectOutput',1, 'HeaderLines',1); fclose(fid); I then process the file and change a few values of the column. Now I want to write a new file newfile.txt in the exact same format as my file.txt with the new