[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problem using fscanf

From: Bård Skaflestad
Subject: Re: Problem using fscanf
Date: Fri, 15 Apr 2011 16:46:38 +0200

On Fri, 2011-04-15 at 12:23 +0200, Bård Skaflestad wrote:
> Still, using "load" is probably easier for this task as you don't have
> to remember to close the file once you're done with it:
>    a = load("sunspot.dat");
>    a = a(:,2);

On the other hand, using "fscanf" allows you to do this if the first
column is truly inconsequential in your application

   a = fscanf(f, "%*d %f");

This may be significant (in terms of memory) if your input ever grows
large (several million rows).

Bård Skaflestad <address@hidden>
SINTEF ICT, Applied Mathematics

reply via email to

[Prev in Thread] Current Thread [Next in Thread]