I use the following code, but when I open changing.txt, it shows:
547.0 0.0000 547.0 360.0 iri_pd_lon280.txt
The second variable '0.0000' should be '0.3720'.
calc_alt=547.5000;calc_W=0.3720;alt_Bw=547.5000;alt_nm=360;filenames='iri_pd_lon280.txt';fmt='%8.1f %.4f %8.1f %8.1f %s\r\n';%format for fprint
fileID=fopen('changing.txt','a');fprintf(fileID,fmt, [calc_alt calc_W alt_Bw alt_nm filenames]);%write these values at the end of the file
fclose (fileID);
Best Answer