[Top][All Lists]

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

Using liboctave in matlab

From: Frederic Gobry
Subject: Using liboctave in matlab
Date: Tue, 15 Jul 1997 18:02:16 +0200


I'm looking for   a conveniant way  to   use C++ code   in both Octave
 and Matlab. In fact, I want to  write some code  that can be compiled
into a .oct and a .mex without (or with few) modifications.

My first idea was  to write code as if  it were for octave (using  the
Matrix classes  in  liboctave) and to  add  a wrapper for  matlab that
converts its input  and output into  octave's matrices.  Here come the
problems :   I can compile my  code,  I can  load it  dynamically into
matlab,  and it seems  to work quite  well, except  that I encounter a
"Segmentation violation" when I try to  clean the .mex from the memory
(with a 'clear function' or when I  exit).  In fact, I've noticed that
simply linking  a normal mexfile with  liboctave,libcruft,..., without
even using a function it provides, is enough to cause this behavior.

Does anybody  know what's happening, or  maybe if there is another way
to use the same code with both programs ?? 

Thank you in advance !


PS : 

I use :

- Octave 2.0.9  on   Solaris 2.5.1,  compiled with shared   libraries,
dynamic linking and lite kernel.

- My version of Matlab is 4.2c

- gcc

- fortran compiler f77 3.0.1 (sun compiler)

    Frederic GOBRY               IDIAP
                            Rue du Simplon 4,
address@hidden     CH 1920 - Martigny
Tel: +41 27 721 77 31       Switzerland

reply via email to

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