j***@gmail.com
2011-01-31 15:57:17 UTC
Hi all,
I have been looking for an answer to a very simple question:
How do I return more than one argument from an octave C++ function.
The following is a simple example of a function that returns a single
argument. How do I modify it to return a 2nd argument of different
type?
#include <octave/oct.h>
DEFUN_DLD(matMult,args, , "Test function.")
{
ComplexMatrix a(args(0).complex_matrix_value());
Matrix b(args(1).matrix_value());
ColumnVector c(args(2).vector_value());
return octave_value(a*2);
}
I would be inclined to create a octave_value_list object that contains
more than one return value. But it is not clear how to do that. The
constructor for octave_value_list can accept an Array. But how to
create an array? The array constructor requires an array to create...
Thanks to anyone willing to rescue me here.
Jay
I have been looking for an answer to a very simple question:
How do I return more than one argument from an octave C++ function.
The following is a simple example of a function that returns a single
argument. How do I modify it to return a 2nd argument of different
type?
#include <octave/oct.h>
DEFUN_DLD(matMult,args, , "Test function.")
{
ComplexMatrix a(args(0).complex_matrix_value());
Matrix b(args(1).matrix_value());
ColumnVector c(args(2).vector_value());
return octave_value(a*2);
}
I would be inclined to create a octave_value_list object that contains
more than one return value. But it is not clear how to do that. The
constructor for octave_value_list can accept an Array. But how to
create an array? The array constructor requires an array to create...
Thanks to anyone willing to rescue me here.
Jay