I'm trying to initialize a complex matrix in c++ code. The code is
ComplexMatrix matr = ComplexMatrix (2,2);
for (int r=0;r<2;r++)
{
for(int c=0;c<2;c++)
{
matr(r,c)=(r,c);
}
}
in(0) = octave_value (matr);
std::cout << in(0).complex_matrix_value()<< std::endl;
I get the following output
(0,0) (1,0)
(0,0) (1,0)
How do I assign values to the imaginary part of a complex value in a complex matrix?