Integration with C/C++(C#)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Integration with C/C++(C#)

Robert Bielik
Hi all,

I'm looking to use Octave within an application, but I'd like to be able to dynamically provide variables to the running Octave interpreter:

int result = feval("plot(my_var)",...)

where the value of my_var should be provided to Octave "on demand"... through a callback or something... 😊

Is this possible ?

Regards
/Robert

_______________________________________________
Help-octave mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-octave
Reply | Threaded
Open this post in threaded view
|

Re: Integration with C/C++(C#)

Pantxo
Robert Bielik wrote

> Hi all,
>
> I'm looking to use Octave within an application, but I'd like to be able
> to dynamically provide variables to the running Octave interpreter:
>
> int result = feval("plot(my_var)",...)
>
> where the value of my_var should be provided to Octave "on demand"...
> through a callback or something... 😊
>
> Is this possible ?
>
> Regards
> /Robert
>
> _______________________________________________
> Help-octave mailing list

> Help-octave@

> https://lists.gnu.org/mailman/listinfo/help-octave

The best resource I know of is the "examples/code" directory in the Octave
source.
You'll find, among others,  "embedded.cc" that shows you how to use Octave
from a foreign C++ program and embed an instance of the interpreter.  

You can compile this example using

mkoctfile --link-stand-alone -o embedded embedded.cc

Important notes:
* The above example works but crashes at exit. This bug has been fixed in
the development branch
* The interpreter has been refactored in depth and the way to embed Octave
4.4 (or the next major version of Octave) will be very different.

Pantxo




--
Sent from: http://octave.1599824.n4.nabble.com/Octave-General-f1599825.html

_______________________________________________
Help-octave mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-octave