help-octave
[Top][All Lists]
Advanced

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

Re: Transform list into matrix


From: Ismael Núñez-Riboni
Subject: Re: Transform list into matrix
Date: Mon, 30 Jan 2012 15:07:58 +0100
User-agent: Mozilla/5.0 (X11; Linux i686; rv:8.0) Gecko/20111124 Thunderbird/8.0

If it is a text file in which each row has the same number of columns I see no reason why the function load should not work (i.e., if you have enough RAM).

Otherwise, you will have to use:

   fid = fopen(yourfilename);
   if fid==-1
     error('File not found or permission denied');
   end

   linea = fgetl(fid); %
   while linea>0

      %%% here you process the values in linea

      linea = fgetl(fid); % read a new line

      pp = pp +1;

   end % while

Think if you can you process each line at time (then save the output on disk) or if you really have to load all of them (i.e. the whole file)... Cheers.


reply via email to

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