help-octave
[Top][All Lists]
Advanced

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

using .m scripts in C++ programs


From: Ken Massey
Subject: using .m scripts in C++ programs
Date: Wed, 9 Apr 2008 17:08:56 -0400

How can I use existing .m scripts in my C++ code?  e.g. the one to
find the rank of a matrix:

  
http://velveeta.che.wisc.edu/cgi-bin/cvsweb.cgi/~checkout~/octave/scripts/linear-algebra/rank.m?rev=HEAD&content-type=text/plain

Do these .m scripts have compiled versions I can link into my C++ program?


#include <octave/oct.h>
int main (void) {
       int n = 2;
       Matrix A = Matrix (n, n);
      A(1,1)=1;  A(1,2) =2;
      A(2,1)=2;  A(2,2) = 4;

     // how can I do something like this?
       std::cout << rank(A);
              //  or
       std::cout << A.rank();
}


reply via email to

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