help-octave
[Top][All Lists]
Advanced

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

Returning more than one argument from OCT file


From: jayt0808
Subject: Returning more than one argument from OCT file
Date: Mon, 31 Jan 2011 07:52:22 -0800 (PST)

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 thing.  But it is not clear how to do that.

Thanks to anyone willing to rescue me here.

Jay

-- 
View this message in context: 
http://octave.1599824.n4.nabble.com/Returning-more-than-one-argument-from-OCT-file-tp3249014p3249014.html
Sent from the Octave - General mailing list archive at Nabble.com.


reply via email to

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