How can I interface with octave with C++?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

How can I interface with octave with C++?

posadasarraez
Hi,

I'm an student and I'm working with Octave. I've the same issue than
this user:

https://www.daniweb.com/programming/software-development/threads/445631/how-can-i-interface-with-octave-with-c

I have a .mat file and I can work with it in Octave without any problem.
I need load that file in a C++ program and
I wonder if is there any example code or something that could help me.

Thanks,
Miguel


Reply | Threaded
Open this post in threaded view
|

Re: How can I interface with octave with C++?

Andreas Weber-6
Am 09.02.21 um 09:57 schrieb posadasarraez:
> I need load that file in a C++ program and
> I wonder if is there any example code or something that could help me.

Hi Miguel, there is an example in the source tarball:
examples/code/embedd.cc
which shows howto call GNU octave from C++. Keep in mind that you link
against GNU Octave and thus your project needs to be GPL compatible.

If you just want to read a .mat file (and not doing any calculations in
GNU octave) you might have a look at something like
https://github.com/tbeu/matio

-- Andy


Reply | Threaded
Open this post in threaded view
|

Re: How can I interface with octave with C++?

Carlo de Falco-3
In reply to this post by posadasarraez


Il 9 feb 2021 09:57, posadasarraez <[hidden email]> ha scritto:

Hi,

I'm an student and I'm working with Octave. I've the same issue than
this user:

https://www.daniweb.com/programming/software-development/threads/445631/how-can-i-interface-with-octave-with-c

I have a .mat file and I can work with it in Octave without any problem.
I need load that file in a C++ program and
I wonder if is there any example code or something that could help me.

Thanks,
Miguel


Hi,

If what you need is ti read and write data in octave formats, you may find this class useful :

https://github.com/carlodefalco/octave_file_io

I write it for myself to simplify this task, it was not intended for distribution but it may be useful as an example...

c.