I am trying to send an array that is [2 x N] doubles large to a text file using the fprintf()
command. I am having problems in that fprintf()
is not recognizing the new line command (\n
) or the carriage return command (\r
). The code I am using is
fid = fopen([Image.Dir,'CtlPts_',Image.Files{k},'.txt'],'w');
fprintf(fid,'%.4f\t%.4f\n',control_points{k});
fclose(fid);
where the data I am trying to print is in the cell control_points{k}
.
The tab gets printed fine, but everything in the text file gets printed on one line, so this is why I am assuming that it is ignoring my new line character.
Is there something wrong with my syntax that I am not seeing?