help-octave
[Top][All Lists]
Advanced

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

Re: addpath, undefined functions


From: Philip Nienhuis
Subject: Re: addpath, undefined functions
Date: Mon, 11 Jul 2011 11:44:49 -0700 (PDT)

Hi Peter,

To be able to help you we need relevant info:


Summers, Peter wrote:
> 
> I've just installed Octave 3.2.4 on a Windows 7 machine, and tried to run
> a couple matlab function files. I placed these in a \programs folder in
> the Octave directory, then pointed to them using addpath(). 
> 

1. What is the exact path to the Octave install directory? Does it contain
spaces (e.g.,
"C:\Program Files\Octave" ?)

2. Exactly what did the addpath() command look like?
(asking because we don't know if you've entered the path relative to the
Octave install directory or as a complete Windows path with backslashes -
the latter should be OK)



> Although the directory shows up when I list Octave's path, I get an error
> when trying to call the functions. For example, the line "h =
> coher(x,y,8)" generates the error "'coher' undefined on line 8" 
> 

So what does the path() output look like?

We can't see if there's any glitch you might be overlooking but we can spot.
Nor do we know what coher.m looks like.



> ('coher' is one of the function files). Further, I get the same error even
> when running Octave in the \programs folder. Octave seems to be running
> fine otherwise -- eg, I can plot the series x &  y no problem. The file
> opens fine in notepad++ as well.
> 
> There was a similar thread last month that referred to this bug:
> https://savannah.gnu.org/bugs/?33389. My problem is different in that I'm
> not trying to access any network drives -- everything is local.
> 

I've never attempted to install user scripts within the Octave installation
directory, I usually put them outside, somewhere in my local Windows profile
or on another partition in project directories.
Only exception are packages (octave-forge packages).

For a start, you can try to put a simple function file test.m at the same
location and see if it gets picked up:

#======= cut here =========
ret = function test (a, b)
ret = a + b;
endfunction
#======= cut here =========

and calling it by c = test (a, b)

If this doesn't work, put your ML files + test.m outside Octave, and try
again.

If that still doesn't work, report back.

Philip


--
View this message in context: 
http://octave.1599824.n4.nabble.com/addpath-undefined-functions-tp3659711p3660431.html
Sent from the Octave - General mailing list archive at Nabble.com.


reply via email to

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