help-octave
[Top][All Lists]
Advanced

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

About .oct file


From: Shiou-Jhy Ja
Subject: About .oct file
Date: Thu, 19 Mar 1998 17:51:01 -0600

Hi:

        I saw a old post in 1997 about recompile .oct file, then calling it
without restart octave will cause segmentation fault.  It still happened
for octave2.0.11 on linux with gcc 2.7.2, libc.so.5 .  Is ther a cure? 

        Also I'm trying to compile some known C routin to .oct file and having
some question:

1) how to extrat data(string, double, ..) from octave command line?
What I mean is something like:
  char *str;
  str=strcpy(arg(0).string_value(),' ');

and it didn't work.

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


It works, however, I would like to know a better way to do it.


        Last question, is there any easy code that can help me learn about
writing .oct code?

Thanks for help


Puck
address@hidden



reply via email to

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