Writing mixed code Octave and C++

I need to speed up my Octave code, so I decided to port some of them to C++. The great things is that, it turns out not so difficult to port from the available octave code to C++. Octave provides the library to do matrix operations, vector, eigenvalue, linear algebra in C++ objects/functions.

For more info, the first step is to go to the Octave Wiki:


Then, read an easy introductory article


And the most useful page for me is the CPP Quick Reference:


Octave C++ class doxygen documentation:


And there is this document written by Mathias on how to use liboctave for your C++ code:



4 Responses

  1. Hi there.. I was wondering is there a way to call the control system toolbox functions of octave from C.. like I do not know if there exists a “.h” file for the control toolbox/ functions of octave. I am specifically looking for ARE (Algeraic Riccati Equation Solver)


    • Hi Sandip, you need to use

      #include  "octave/oct.h"

      if you want to use the octave classes and functions. You can read the references that I put up there for more detail. In the worst case, you can simply port the are.m function. You can locate the function at the following folder (I am using octave 3.0.1) after you untar the source code:


  2. Thank you for the reply. I am using octave/oct.h for basic matrix manipulations.
    But in any of your references have not found anything related to control systems functions (like “are”).

    Can you help me understand : simply port the are.m (i can locate the file), I do not know anything on this front, a bit of elaboration will really help. How do i port it and how do i use it?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: