help-octave
[Top][All Lists]
Advanced

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

Re: using .m scripts in C++ programs


From: Carlo de Falco
Subject: Re: using .m scripts in C++ programs
Date: Thu, 10 Apr 2008 10:16:47 +0100


On 09/apr/08, at 22:08, Ken Massey wrote:
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();
}
_______________________________________________
Help-octave mailing list
address@hidden
https://www.cae.wisc.edu/mailman/listinfo/help-octave

You can use feval.
See for example this thread for more information:
https://www.cae.wisc.edu/pipermail/help-octave/2008-April/008712.html
c.



reply via email to

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