Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: Unable to get new line fprintf
Replies: 6   Last Post: Aug 25, 2014 1:15 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Stan24

Posts: 10
Registered: 11/24/12
Re: Unable to get new line fprintf
Posted: Mar 17, 2013 6:47 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

dpb <none@non.net> wrote in message <khvv78$veb$1@speranza.aioe.org>...
> On 3/15/2013 1:42 PM, Steven_Lord wrote:
> ...
>

> > If you're using Windows, open the file in the MATLAB Editor or in
> > Wordpad instead of opening it in Notepad.

>
> But isn't it still better to ensure the correct newline character(s) for
> the OS (that is, the 'wt' option which can't hurt, anyway)?
>
> I have some other app's besides Notepad that are also sensitive altho
> granted most may never know the difference...
>
> --
>
>


Operating systems usually represent a newline with one or two control characters:
LF - Unix(Linux) and CR+LF for Windows.
fid = fopen('testWrite.txt','w');
mystring = 'aX';
fprintf(fid,'Name: %s\r\n',mystring);
fprintf(fid,'%d',21);
fclose(fid);



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.