help-octave
[Top][All Lists]
Advanced

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

Octave c++ execution exception


From: dragan mladenovic
Subject: Octave c++ execution exception
Date: Mon, 18 Jun 2012 18:00:53 +0200

I trying to use Octave from Visual C++, so I wrote this:

#include <octave/octave.h>
#include <octave/oct.h>
#include <octave/parse.h>


int main(int argc, char **argv)
{
    //SetCurrentDirectory(L"");
    if (octave_main (argc, argv, true))
    {
        ColumnVector NumRands(2);
        NumRands(0) = 10;
        NumRands(1) = 1;
        octave_value_list f_arg, f_ret;
        f_arg(0) = octave_value(NumRands);
        f_ret = feval("rand",f_arg,1);
        Matrix unis(f_ret(0).matrix_value());
    }
    else
    {
        error ("Octave interpreter initialization failed");
    }
    return 0;
}

It compiles fine but the feval function thows exception.
On C++ side:Microsoft C++ exception: octave_execution_exception at memory location 0x0012faef , and on Octave side : Invalid resizing operation or ambiguous assignment  to an out-of-bounds array element.
The sample is from Ocatve wiki. What am I doing wrong ?
Thanks in advance.


reply via email to

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