Hi:

Thanks for peoples for replying my questions. But I didn't express my

question clear enough. What I need is to conver the octave

objects(Matrix, string, ...) to C++ objects(double *, char *,...).

Because I only have some c++ routines in the library form(no source

available), so I can't modify those source codes to make them accept

octave objects. Therefor, I need to transform the data which is send

from octave console back to the type that c++ compiler can accept.

For example:

A function available in tools.a:

double spline(double *x, double *y, double Ix)

and I like to call it from octave:

octave:> vec_Iy = Cspline( vec_x, vec_y, vec_Ix);

> In post "RE: About .oct filt":

>

>| for matrix, I use a silly way to do it:

>|

>| Matrix oct_x=arg(0).matrix_value();

>|

>| int n=oct_x.column(); //assume it's a row vector

>|

>| double *x=new double[n];

>|

>| for (int i=0; i<n; i++)

>| x[i]=oct_x(0,i);

>|

>| then I can call other routin with x

>

>You can extract the data from an Octave Matrix object using

>

> const double *d = val.matrix_value().data()

If I use the approach above, then the type mismatch happened(ie. const

double* and double*).

Another question is about converting octave object, string, to c++

object, char*, instead of assign a string to octave_value.

>..., you need to use

>

> arg(0).string_value().c_str()

>

>but that returns `const char *', so you can't use that as the first

>argument to strcpy. If you are trying to assing a character string to

>an Octave object, just do it:

>

> octave_value val = "foobar";

So how can I get a 'char *' instead of 'const char*'?

Thanks for your kindly help. Programing is not my major, so please

bear with my such simple questions!

Puck

[hidden email]