[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: load
From: |
Vincent Stanford |
Subject: |
Re: load |
Date: |
Sun, 24 Sep 2000 20:18:13 -0400 |
Dear Dave,
I don't know if this is what you need, but here is what I did:
function computePDFs
>
> %----------------------------
> % open file and read in data
> %----------------------------
>rawSoundFile=fopen("SoundCheck.22k","r","native");
>[x,n]=fread(rawSoundFile,Inf,"int16",0,"native");
>
> xMean=sum(x)/n
>
...
This reads the file SoundCheck.22k from the directory that I am running
the emacs session with the inferior octave mode ession. The file is just
a bunch of shorts (int16), and gets turned into the usual double array.
Guess you could put in a fully qualified file name if you don't want to
read from the session directory. Hope this helps.
Vince Stanford
David DS Barnes wrote:
> Hi all,
>
> I'm trying to load a file from within a function,
> I know the file exists within a subdirectory,
> and I have assigned a string 'wFile' as 'subdir/file'
> when I put the line
>
> load wFile
>
> in the function, I get the message:
>
> error: load: couldn't open input file `wFile'
>
> but if I repeat the command on the command line,
> I can load it just fine
>
> Can anyone help me here, since I really need to
> have this in a repeatable way...
>
-----------------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.
Octave's home on the web: http://www.che.wisc.edu/octave/octave.html
How to fund new projects: http://www.che.wisc.edu/octave/funding.html
Subscription information: http://www.che.wisc.edu/octave/archive.html
-----------------------------------------------------------------------