The Math Forum

Search All of the Math Forum:

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

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

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

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 ]

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 <> wrote in message <khvv78$veb$>...
> 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);

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

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.