[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Integration with C/C++(C#)
From: |
Pantxo |
Subject: |
Re: Integration with C/C++(C#) |
Date: |
Wed, 13 Sep 2017 05:13:59 -0700 (MST) |
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