Using external C++ functions from Octave

Tatsuro MATSUOKA tmacchant at yahoo.co.jp
Tue Sep 2 14:39:04 CDT 2008


Hello
Perhaps you have to write wrapper code to the open source code.

Please read:
 A.1.9 Calling External Code from Oct-Files
in the octave manual, Appendix A: Dynamically Linked Functions.

That is what you want, I think.

Regards

Tatsuro

--- Tamara Bechtold <tamara.bechtold at gmail.com> wrote:

> Dear all,
> 
> I am trying to read in aggument in Octave and pass them to a C++ 
> function to be compiled. I want to read-in a single argument which can 
> be either double or int, say the user gives 1 or 1.0. Within the c++ 
> function I am trying to check what kind of argument was passed by the 
> user with following code:
> int m;
> double n;
> if (args(3).is_scalar_type())
>  m = args(3).int_value();
> if (args(3).is_double_type())
>  n= args(3).double_value();
> But it does not work. In other word when I pass 10.0 both variables, m 
> and n are initialized with 10! I want only n to get the value 10.0. How 
> can this be done? Can enybody help?
> Many thanks in advance.
> Tamara
> _______________________________________________
> Help-octave mailing list
> Help-octave at octave.org
> https://www-old.cae.wisc.edu/mailman/listinfo/help-octave
> 


--------------------------------------
Enjoy MLB with MAJOR.JP! Ichiro, Matsuzaka, Matsui, and more!
http://pr.mail.yahoo.co.jp/mlb/


More information about the Help-octave mailing list