help-octave
[Top][All Lists]
Advanced

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

Re: standalone application (octave to c++): define anonymous function fo


From: mmuetzel
Subject: Re: standalone application (octave to c++): define anonymous function for nonlin_curvefit()
Date: Thu, 31 Jan 2019 06:14:28 -0600 (CST)

I didn't try this myself. But that part of your code:
    std::string f = "@(p,x) 1-exp(p(1)*x)";
    extern octave_value make_fcn_handle(const std::string& f, bool
local_funcs = true);
    octave_value_list result = octave::feval("nonlin_curvefit", ovl(f, init,
x_val, y_val, opt(0)), 4);

should probably better be:
    std::string f = "@(p,x) 1-exp(p(1)*x)";
    octave_value_list result = octave::feval("nonlin_curvefit",
ovl(make_fcn_handle(f), init, x_val, y_val, opt(0)), 4);

Markus



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



reply via email to

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