help-octave
[Top][All Lists]
Advanced

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

Re: Calling Octave functions from C


From: A S Hodel
Subject: Re: Calling Octave functions from C
Date: Mon, 23 Aug 2004 10:15:51 -0500

This depends in part on what octave functions you want to use:
the basic numerical functions are largely written in fortran.
the octave class structure is in C++.

Your compiler should let you link with these (although you'll need to use a C++ compiler to link your C code with the octave library). I have no experience doing that, although others have done so.

If you want to call octave m-file scripts from C code, then you're dealing with a slightly more difficult operation. You can use the feval function in an Octave .oct file, but it seems the most convenient way to do that is to set up your C code within a .oct gateway and call it from Octave directly.

Be forewarned that calling scripts will slow down your code a great deal.

On Aug 23, 2004, at 10:02 AM, Shayne C. Rich wrote:

I desire to call octave functions from C or C++.

What I am trying to do is use some of the graphing and analysis
functions of Octave for my application instead of writing my own.

For clarification, I am working on a windows machine, which compiler
will I need, do I need to switch to Linux?

Thanks,

Shayne C. Rich
690 S 200 E
Wellsville, UT 84339
Tel: 435-245-6031

-----Original Message-----
From: A S Hodel [mailto:address@hidden
Sent: Monday, August 23, 2004 7:51 AM
To: Shayne C. Rich
Cc: address@hidden
Subject: Re: Calling Octave functions from C

Did you write that backward?  Are you asking to call legacy "C" code
from within Octave (which is what mex files do),
or are you asking to call octave m-file scripts/functions from external
C code (which is what the Matlab engine
did/does)?

The first is done through .oct files (there are examples on the net and
in the octave source code).
The second is done by linking with the octave libraries (C++, rather
than C), but others will need to speak to that.

On Aug 20, 2004, at 3:51 PM, Shayne C. Rich wrote:

Hi, is it possible to call Octave functions from “C” programs, similar

to Matlab mex files?

 

Thanks,

 

Shayne C. Rich

Microbial Aerosol Biodetection System

1780 N Research Park Way

North Logan, UT 84341

Tel: 435-797-3431

Fax: 435-797-3328

address@hidden

 

A. S. Hodel Dept. ECE, 200 Broun Hall, Auburn University AL 36849-5201
(334) 844-1854/fax(334) 844-1809,
http://www.eng.auburn.edu/users/hodelas , address@hidden



A. S. Hodel Dept. ECE, 200 Broun Hall, Auburn University AL 36849-5201
(334) 844-1854/fax(334) 844-1809, http://www.eng.auburn.edu/users/hodelas , address@hidden



-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------



reply via email to

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