Need HELP getting started with octave.

  • Thread starter uart
  • Start date
  • Tags
    Octave
In summary, the person is asking for help with using the open source "octave" math program and is specifically having trouble allowing included functions to access their user-defined functions. They mention trying to use the "quadc" routine but it is not working, and they are looking for tips on where to place user "m" files and find online help. They also mention running Octave under Windows and wondering if it has been properly ported. Another person suggests making sure the M files are in Octave's include path and recommends asking for help on the Octave forum on Sourceforge.net.
  • #1
uart
Science Advisor
2,795
21
Hi, appologies if this isn't the best forum for this question, I'd like to get some help (or find out where to get help) on using the open source "octave" maths program.

It's a very specific question, I have to find out how to allow included (library) functions to be able to access my user defined functions. When using the included numerical integration routines (say "quad.m" for example) they require a user function to be passed as a string. I can write the "m file" to define the user function and check that it works from the command line but I get an error any time that I try to pass this function to one of the integration routines like "quad". I'm sure there's a path or similar environment variable that I need to set, are there any octave users here that can give me a clue.

BTW, I'm running GNU octave 2.1.50 under Windows XP. I'm familiar with MATLAB and can easily make all this stuff work in matlab. It must be something simple to make it work in octave if I could just get started.
 
Mathematics news on Phys.org
  • #2
Quick update.

Sorry there was some mis-information in the above. I was actually trying to use the routine called "quadc" and it wasn't working (and still isn't). But know I just tested the basic "quad" routine (called in exactly the same way as I was attempting to call quadc) and it actually does see my user function and does numerically integrate it correctly.

BTW. I made the user function as an "m" file in the "/octave_files" directory. I guessed that directory by typing "pwd" from the command line and that was what was indicated.

I'd still like some tips on the best path to place user "m" files and tips on good places to find online help if there are any octave users here. PS. Remeber I'm running under Windows and not Linux.

Thanks.
 
  • #3
Yeah I still haven't resovled this. It looks like it works with "quad" because it's an inbuilt function but any functions that are implemented as "m" files don't seem able to see my user defined function. It must be a configuration problem.

Is anyone here using ocatave under Windows? I'm thinking maybe it just hasn't really been ported properly to windows.
 
  • #4
You need to make sure your M files are in Octave's include path. I don't recall at the moment whether this is defined as an environment variable under Windows or specified in a config file. See http://www.octave.org/doc/octave_14.html#SEC103

A better place to ask might be the Octave forum over at Sourceforge.net
 
Last edited by a moderator:

1. How do I install Octave on my computer?

To install Octave, you can either download the installer from the official website or use a package manager (such as Homebrew for Mac or apt-get for Linux) to install it. Make sure to follow the instructions carefully and check for any system requirements before installing.

2. What are the basic commands in Octave?

Some of the basic commands in Octave include assigning variables, performing mathematical operations, creating and manipulating matrices, and plotting graphs. You can refer to the official documentation for a comprehensive list of commands and their usage.

3. How can I import data into Octave?

You can import data into Octave using the load command or by using the csvread function if your data is in a CSV format. You can also use other functions such as xlsread for Excel files or fread for text files.

4. How do I debug my code in Octave?

To debug your code in Octave, you can use the built-in dbstop function to set breakpoints, dbstep to step through your code, and dbcont to continue running your code after a breakpoint. You can also use the dbquit function to exit the debugging mode.

5. Can I use Octave for machine learning or data analysis?

Yes, Octave is a popular choice for machine learning and data analysis tasks due to its ease of use and powerful capabilities. It has a wide range of functions and packages specifically designed for these tasks, making it a useful tool for researchers and data scientists.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
6
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
13
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
2K
  • Calculus and Beyond Homework Help
Replies
1
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
1K
Replies
11
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
2K
Back
Top