I am trying to send an array that [2 x N] doubles a large size to a text file using the command fprintf(). I'm having trouble fprintf()not recognizing a new command line ( \n) or carriage return command ( \r). The code I'm 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'm trying to print is in a cell control_points{k}.
The tab printed fine, but everything in the text file is printed on one line, so I assume that it ignores my new line character.
Is there something wrong with my syntax that I can't see?
source
share