help-octave
[Top][All Lists]
Advanced

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

Re: Accessing Octave functions from DEFUN_DLD files


From: Geraint Paul Bevan
Subject: Re: Accessing Octave functions from DEFUN_DLD files
Date: Thu, 02 Sep 2004 17:10:17 +0100
User-agent: Mozilla Thunderbird 0.7.1 (X11/20040715)

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

P S Bettridge wrote:

| I have successfully created a dynamically linked function written in
C++ which
| continuously accesses packets of data and creates a set of global
variables but
| cannot seem to find a way to implement a user defined Octave function
or script
| from the DEFUN_DLD file. Is there a way to refer to such a function in
C++ ?
|

When you say "implement", do you mean 'call' or 'define'? You can call
scripts and functions (m files) using the 'feval' function. You will
have to #include <octave/parse.h> for this.

| Also I keep having trouble with accessing data from Octave into C++
because I
| can't find a way to convert from an octave_value to a float or double.
Is there
| a way to do this?
|

To convert an octave_value to double, use the 'double_value()' method:
octave_value x = whatever; double y = x.double_value();

- --
Geraint Bevan
http://www.mech.gla.ac.uk/~gbevan

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iEYEARECAAYFAkE3RekACgkQcXV3N50QmNNA4ACgh7xMKtxNF2o2b35kJ3jGs1Ub
oy0An11SxFtLbKEubL4uO6MtgKh0y7Fe
=WZkj
-----END PGP SIGNATURE-----



-------------------------------------------------------------
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]