help-octave
[Top][All Lists]
Advanced

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

RE: Very slow reading of a 2D matirx


From: Alireza
Subject: RE: Very slow reading of a 2D matirx
Date: Thu, 20 Oct 2005 22:38:57 -0500

I guess the best way to achieve this is to extend the load command with an
option to set its search path to either the working directory or the script
directory, for example

load -use_script_dir filexx.dat
load -use_current_dir filexx.dat (default)

Ali

> -----Original Message-----
> From: Mike Miller [mailto:address@hidden
> Sent: Friday, 21 October 2005 12:39 PM
> To: Henry F. Mollet
> Cc: Alireza; Octave_post
> Subject: Re: Very slow reading of a 2D matirx
>
>
> On Thu, 20 Oct 2005, Henry F. Mollet wrote:
>
> > Thanks for clarification. Can you please elaborate about the difference
> > of reading data from a data file compared to using a script. Thanks.
>
>
> Suppose I were to write a script that would load a big matrix
> into memory.
> I could write a one line script like this:
>
> load big_matrix.dat
>
> But then big_matrix.dat would have to be in my default directory.  If I
> wrote it like this:
>
> load /path/to/files/big_matrix.dat
>
> Then the user would have to store the matrix in a certain place.  I can't
> think of an easy way to ensure that the data is stored where the script
> can find it.  Any ideas?  Maybe it could use "which" to find out
> where the
> script was located, then look for the file in the same place, but I don't
> quite no how to write such a script.
>
> It would be nice if I could write the script like this...
>
> big_matrix = [ 2 1 3
> 4 5 6
> ...
> 7 8 9];
>
> ...and have it read in without having to find the data file.  See what I
> mean?  Maybe someone has an elegant way of finding a file or of
> associating a file with a script.  That would be nice.
>
> I need to be able to do this kind of thing myself, so I'm genuinely very
> interested in seeing other ideas.
>
> Mike



-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------



reply via email to

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