[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Problem creating compiled oct file
From: |
Søren Hauberg |
Subject: |
Re: Problem creating compiled oct file |
Date: |
Sat, 03 Oct 2009 13:03:56 +0200 |
lør, 03 10 2009 kl. 03:54 -0700, skrev babelproofreader:
> DEFUN_DLD (loop, args, , "Help String")
> {
> octave_value retval;
> double numbers = args(0);
> // Do something
> octave_stdout << "The input values are " << numbers << "\n";
> retval = numbers;
> return retval;
> }
>
> The input, args(0), is a column vector of values, but when I try compiling I
> get the error message
C++ has a much more strict type system, so you can't expect it to work
out types for you at run-time. You need to do something like
ColumnVector c = args (0).column_vector_value ();
octave_stdout << c (0) << std::endl;
To see which member functions the 'octave_value' class has, you can look
at
http://octave.sourceforge.net/doxygen/html/classoctave__value.html
To get some more knowledge about the C++ API, you might want to read the
Appendix in the Octave manual.
Søren