help-octave
[Top][All Lists]
Advanced

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

Re: call octave functions direction from c++ (not using feval() )


From: tosandip
Subject: Re: call octave functions direction from c++ (not using feval() )
Date: Mon, 22 Feb 2010 22:37:15 -0800 (PST)

I am trying to call octave function "are" in my c code , i.e. in the control
function list of octave, it is not in the liboctave or the c++ function list
of octave, can you please help me in how to use the function are of octave
in c code. 


daviddoria wrote:
> 
> I know how to call octave function from c++, for example, to integrate the
> function x^2 from 0 to 2 using "quad", I can do
> 
> #include <octave/octave.h>
> #include <octave/oct.h>
> #include <octave/parse.h>
> 
> int main(int argc, char **argv)
> {
> octave_main (argc, argv, 1)
> f_arg(0) = "x^2";
> f_arg(1) = 0;
> f_arg(2) = 2;
> f_arg(3) = octave_value(m);
> f_ret = feval("quad", f_arg);
>       
> double ans = f_ret(0).double_value();
> }
> 
> However, is there a way to call directly the function quad() that octave
> calls (ie skip the interpreted language step)? I am using fedora so I have
> the octave source - seems like this should be possible.
> 
> Anyone have any hints?
> 
> Thanks,
> Dave
> 

-- 
View this message in context: 
http://old.nabble.com/call-octave-functions-direction-from-c%2B%2B-%28not-using-feval%28%29-%29-tp20901391p27699067.html
Sent from the Octave - General mailing list archive at Nabble.com.



reply via email to

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