help-octave
[Top][All Lists]
Advanced

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

Re: cart2pol and external code interface


From: Markus Mützel
Subject: Re: cart2pol and external code interface
Date: Fri, 15 Oct 2021 16:16:19 +0200

You can check on Octave's interactive prompt using the function `which` whether a function is a built-in function or a .m file function.
E.g.:
which cart2pol
 
The C++ interface is "documented" by the headers.
The best way to search that is probably with Doxygen:
GNU Octave: Main Page
 
In particular for octave::feval:
GNU Octave: octave Namespace Reference
 
HTH
Markus
 
 
Gesendet: Donnerstag, 14. Oktober 2021 um 19:50 Uhr
Von: "Fritz Sonnichsen" <sonnichs@gmail.com>
An: "Markus Mützel" <markus.muetzel@gmx.de>
Cc: help-octave@gnu.org
Betreff: Re: cart2pol and external code interface
Thanks-
  I had gone to this documentation and it worked for the Matrix manipulations. 
  Apparently cart2pol is something different (A built-in function? https://octave.sourceforge.io/octave/overview.html
 
. There is a mysterious in(0) etc used in the call. We can guess what this is but I cannot find any documentation for on the methods of the call.
 
Fritz
 
On Thu, Oct 14, 2021 at 11:59 AM Markus Mützel <markus.muetzel@gmx.de> wrote:
I'm assuming you would like to write a standalone program in C++ that calls Octave. Is this correct?
 
If this is the case, take a look at appendix A.3 Standalone Programs of the Octave manual:
 
It includes an example that calls the Octave function "gcd".
Calling "cart2pol" instead should work similarly.
 
HTH
 
Markus
 
Gesendet: Donnerstag, 14. Oktober 2021 um 17:06 Uhr
Von: "Fritz Sonnichsen" <sonnichs@gmail.com>
An: help-octave@gnu.org
Betreff: cart2pol and external code interface
I have octave running just fine on my ubuntu 16.xx machine. I also ran the octave demo program for calling octave from C++ (external code interface) and this did the Matrix algebra just fine.
  Now I need to run "cart2pol"  but I get "  but I get the errors below:
Any ideas appreciated
Fritz
============ERROR MESSAGES =============================
error: ‘cart2pol’ was not declared in this scope
   cart2pol(1,1);
   ^~~~~~~~
..../comp2: line 2: ./octpolar: No such file or directory
======== COMPLETE CODE ===============================
/////////////////////////////////////////////////////////////////////////////////
#include <stdio.h>
#include <stdlib.h>
#include <complex.h>
#include <iostream>
#include<math.h>
#include <iostream>

#include <octave/oct.h>
int
main (void)
{
  //float theta,rho;
  cart2pol(1,1);
  //std::cout << theta;
  //std::cout << rho;
  return 0;
}
 
---------- We are transitioning to a web based forum for community help discussions at https://octave.discourse.group/c/help

reply via email to

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