help-octave
[Top][All Lists]
Advanced

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

Re: new to octave - need help with running user-defined function files


From: Theresa Bullard
Subject: Re: new to octave - need help with running user-defined function files
Date: Thu, 9 Mar 2006 17:22:55 -0800

Thank you all for the help.

I'm a little closer, but still not there. Here are some more details of what I'm struggling with, using Joe's email as a guide to what info you might need to further help me out.

First, how did you install octave: Fink, HPC, or build from source?

I installed using HPC and have loaded both gnuplot and Aquaterm. I also enabled the octave-forge features by adding (as instructed by the HPC sourceforge site) the following lines to my .octaverc files

LOADPATH = ['/usr/local/libexec/octave/2.1.71/site/oct/powerpc-apple-darwin7.9.0/octave-forge:/usr/local/share/octave/2.1.71/site/m/octave-forge//:',LOADPATH ];
EXEC_PATH = ['/usr/local/libexec/octave/2.1.71/site/exec/powerpc-apple-darwin7.9.0:', EXEC_PATH ];

It makes
a difference as to how you set up your .bash_profile or .bashrc to recognize
things.

How do I set up or change my .bash_profile or .bashrc? Where would these files be located? I do not see them in the home directory. What would I change in these files?

What I usually do is run a Terminal window with AquaTerm available.

OK, I can do that. At what point does AquaTerm come into play? Is it called automatically when I use one of the plotting functions?

First I do a cd into the directory where my .m script resides, and type
octave.

That helps me run the simple test script, finally, but I’m still having trouble accessing other user-defined function files that are in other directories. The function files I want to use for my task at hand were downloaded from:

P. D. Kovesi.   MATLAB and Octave Functions for Computer Vision and Image Processing.
School of Computer Science & Software Engineering,
The University of Western Australia.   Available from:
<http://www.csse.uwa.edu.au/~pk/research/matlabfns/>


Do I need to do a batch compile of these functions to get them integrated into Octave? If so, how do I do that here?

I am able to use the built-in octave functions, although in attempting to use some of the image functions as a basic step before even trying the computer vision functions from Kovesi, I cannot seem to access the image files. I have cd’ed into the directory the image files are stored in, and they are recognized as being in IMAGEPATH, but then I get the following error trying to use imread

octave:2> file_in_path(IMAGEPATH, 'gray_image.jpg')
ans = /Users/tvb/usr/local/share/octave/2.1.71/imagelib/gray_image.jpg
octave:3> im1 = imread('gray_image.jpg')
error: could not read file: /var/tmp/oct-EHDvjn
error: evaluating if command near line 189, column 4
error: called from `imread' in file `/usr/local/share/octave/2.1.71/site/m/octave-forge/image/imread.m'
error: evaluating assignment expression near line 3, column 5
octave:3>

I’ve tried loadimage(‘gray_image.img’) also, but perhaps my file format is not right even though it seemed like it was what Octave was asking for based on the online manual. I have Graphical Converter, so I tried to convert from .jpg to .img and .ppm which seemed to be the file formats that Octave can work with. My preference would be to just use jpg’s and from seeing some of the other threads, it looks like this should be possible.


Further advise and instruction is much appreciated.

Thanks
Theresa



on 3/6/06 6:32 PM, Theresa Bullard at address@hidden wrote:

Dear Octave List,

I am new to Octave and have loaded everything successfully and am able
to run built-in functions and such, but I seem to be having trouble
with getting Octave to see and run any user-defined functions. I've
read the online manual sections dealing with this but am not clear on a
couple points.

1. what is the appropriate syntax to use for changing LOADPATH once
Octave is running?

2. Since I haven't figured out how to add another path for Octave to
search in for function files, I've placed the files in one of the paths
that is already in DEFAULT_LOADPATH
(/usr/local/share/octave/2.1.71/site/m//), and when I use the built in
function 'file_in_loadpath(filename)' it keeps returning empty results
for the all of the new user-defined function files I've downloaded or
that I've created myself. Whereas if I search for octave functions in
the same directory path it will find them. From the manual it seems
like I can add new function or script files even while Octave is
running and as soon as I call the new function from the command line it
should search the directories and then compile it on the fly, if needed
(based on time-stamp). Is this true? If so, why is it not able to see
these new function files or script files I've put into the default
paths? Is there a way to force compile all these functions?

Any clarification or suggestions for getting started here is much
appreciated. I'm running Octave through X-11 in Mac OSX (10.3.9)

Thanks,
Theresa





reply via email to

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