[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Creating .oct files
From: |
John W. Eaton |
Subject: |
Creating .oct files |
Date: |
Wed, 19 Apr 2000 03:19:27 -0500 (CDT) |
On 19-Apr-2000, Peter Gawthrop <address@hidden> wrote:
| 1. It calls user defined .oct functions
| 2. It calsl the octave function reshape
To call another function, whether it is defined in a .oct file or a .m
file, use feval(). For example:
octave_value_list args;
args(1) = p;
args(0) = x;
int nargout = 1;
octave_value_list result = feval ("myfunc", args, nargout);
In Octave 2.1.x, feval is declared in parse.h and defined in parse.y.
| 3. It uses the octave "\" operator.
If you have two octave_value objects, you can use (with Octave 2.1.x):
octave_value result = op_ldiv (x, y);
The op_ldiv function is declared (using a C preprocessor macro,
sorry!) in ov.h.
If you already have two Matrix objects, you can use the solve member
function that is declared in Matrix.h:
int info;
double rcond;
Matrix result = x.solve (y, info, rcond);
(The info and rcond arguments are optional). This method eventually
calls an lapack subroutine.
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
-----------------------------------------------------------------------