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: Problems with fscanf
Replies: 1   Last Post: Aug 15, 1996 9:58 PM

Advanced Search

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

Posts: 7
Registered: 12/7/04
Problems with fscanf
Posted: Aug 14, 1996 1:05 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply


I'm trying to use MATLAB to read in an ASCII file and interpret it.

My problem is that there seems no way to use fscanf to read in a
whole line.

I can read in a white-space delimited word with


But to get I line I must do

c= fread(fid,1);
while c~=10
line= [line c];
c= fread(fid,1);

This is a mega-pain (tm).
Is there a way to do it with fscanf.

Andy Adler, |Meakins-Christie Labs |Lab 514-398-1452|McGill U.,Montréal,Canada|Fax 514-398-7483

Starting from a principle is affirmed by people of experience to
be a very reasonable procedure; I am willing to humour them, and so
begin with the principle that all men are bores. - Kierkegaard

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.