On Mon, 6 Jun 2011 09:53:16 -0700 (PDT), hodjat hajian
<hh.solidst...@yahoo.com> wrote:
> Dear users hi,
> I extract some data in a comma-delimited format in a .dat file, as
> below:
> flux1:, 0.25, 2.64484059275628e-4
> flux1:, 0.250400801603206, 2.87434928639728e-4
> flux1:, 0.250801603206413, 3.12270609926369e-4
> .
> .
> .

Hi Hodjat,
these lines work in Matlab, you mighthave to modify them a bit to get them
working for Octave; you have to assign to the variable flux_data_file the
path of your file



fid = fopen (flux_data_file, 'r');
[val, count] = fscanf (fid, ' flux1:, %f , %f', Inf);
fclose(fid);


Curiously the space before the characters flux1:, in the conversion
specification string is important, otherwise the program reads only the
first line of the input file


Giovanni

----------------------------------------
Message sent by Cup Webmail (Roundcube)


_______________________________________________
meep-discuss mailing list
meep-discuss@ab-initio.mit.edu
http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/meep-discuss

Reply via email to