help-octave
[Top][All Lists]
Advanced

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

Re: how to use fft in c++


From: Kire Pudsje
Subject: Re: how to use fft in c++
Date: Fri, 9 Jun 2017 20:28:53 +0200



On Fri, Jun 9, 2017 at 7:54 PM, Progressive <address@hidden> wrote:
Ok, thanks again! That's nice!

But I still don't get it..   I reduced the code to figure out the problem:


#include <stdio.h>
#include <stdlib.h>
#include <string>
#include <math.h>

#include <oct.h>
#include <builtin-defun-decls.h>
// #include <toplev.h>

using namespace std;

int main()
{

        DEFUN_DLD(testfft, args, nargout, "\testfft\n\")
        {
                octave_value_list retval;
                int nargin = args.length ();

                retval = Ffft (args);
                return retval;
        }

        return 1;
}
 
Get rid of the main. DEFUN is defining a function.
BTW, I might be missing something, but I now have the feeling you are going the opposite way. Oct files are intended to be for calling a cpp file from octave. I thought you were trying the opposite?
https://www.gnu.org/software/octave/doc/v4.2.1/Standalone-Programs.html#Standalone-Programs


reply via email to

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