[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Need help with structures and "eval" function
From: 
John W. Eaton 
Subject: 
Re: Need help with structures and "eval" function 
Date: 
Wed, 22 Mar 2000 16:02:09 0600 (CST) 
On 22Mar2000, Thomas Walter <address@hidden> wrote:
 I'm interested too in how to do it. To be more specific:

 I have a sample function as mfile, but this can be any artificial
 function that's why to use an mfile for the definition.
 function y = myfunc (x, p)
 # x : a value and p : a vector with parameters
 y = p(1) * exp ( x / p(2));
 endfunction

 Now the problem: How to evaluate this function from within an .oct
 file?

 I looked at 'parse.y' and some other files but I still have no idea
 how to do it.
octave_value_list args;
args(1) = p;
args(0) = x;
int nargout = 1;
octave_value_list result = feval ("myfunc", args, nargout);
jwe

Octave is freely available under the terms of the GNU GPL.
Octave's home on the web: http://www.che.wisc.edu/octave/octave.html
How to fund new projects: http://www.che.wisc.edu/octave/funding.html
Subscription information: http://www.che.wisc.edu/octave/archive.html
