from matlab fopen documentation
To open files in text mode, attach the letter "t" to the resolution, for example, "rt" or "wt +". For best performance, do not use text mode. On Windows systems, the following applies in text mode:
Reading operations that occur with carriage returns followed by a newline ('\ r \ n') removes the carriage return from the input.
Write operations insert a carriage return before any newline in the output file.
This additional processing in most cases is not needed. All MATLAB import functions and most text editors (including Microsoft Word and WordPad) recognize both "\ r \ n" and "\ n" as newline sequences. However, when you create files for use with Microsoft Notepad, complete each line with "\ r \ n". For example, see Fprintf.
Marc
source share