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: fprintf is not reading the \n
Replies: 25   Last Post: Jul 2, 2012 11:00 AM

Advanced Search

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

Posts: 16
Registered: 6/18/12
Re: fprintf is not reading the \n -- arrgh...
Posted: Jun 29, 2012 3:28 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

On Fri, 29 Jun 2012 18:41:18 +0000, Ellen wrote:

what I need is a 'do what I mean' computer...

> Someone was suggesting something about how it needs to read and print
> the data line by line, however I don't know how to do that.

fid=fopen('data_file.txt','wt'); % open a target file

for i = 1:7480 % loop on reading data
fprintf(fid,'%14.10e %5.2f\n',First(i,1),First(i,2));

fclose(fid); % close target file

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.