help-octave
[Top][All Lists]
Advanced

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

Re: Scripts and packages


From: James Sherman Jr.
Subject: Re: Scripts and packages
Date: Sat, 5 Nov 2011 15:49:05 -0400

On Sat, Nov 5, 2011 at 2:53 PM, Sean Jacobson <address@hidden> wrote:
Dear Support,

I have Octave 3.2.4 on my computer. I have a Toshiba laptop Window's Vista 64-bit system. I'm trying to figure out how I can write and load scripts into Octave. My main problem is knowing where to save it to and how to load it into the main window. I'm also trying to find a package (or tool kit) that allows me to playback sound files and also to write scripts allowing me to write sound files as well as loading it into Octave. Any help you can give me would be greatly appreciated.

Sincerely,
Sean Jacobson

Hi Sean,

I think you're misunderstanding a bit of the structure of octave.  When you type a command into the octave prompt, what it does is searches for that function within its search path, which includes the current directory, then executes that function.  For example, say I make a file called "addthreenumbers.m" in directory d:\code\ and in that file I have the code:
===
function d = addthreenumbers(a,b,c)
d = a+b+c;
endfunction
===
Now, if I just start up octave (I don't specify any particular working directory when I start it), then I'll be in some directory where octave is run.  So if i type:
addthreenumbers(1,2,3)
It won't find the function because its not in my search path nor in my working directory.
So, either you can add your directory to the search path by doing:
addpath("d:\code\");
or by changing the current directory to that directory:
cd d:\code\

To install packages, which sounds like you're interested in the audio package on http://octave.sourceforge.net/packages.php
Download the file, and then in octave type:
pkg install <path_to_file>
where <path_to_file> is replaced with where you downloaded the package.

Hope this helps,



reply via email to

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