help-octave
[Top][All Lists]
Advanced

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

Imaginary values in Complex Matrix


From: Shamika Mohanan
Subject: Imaginary values in Complex Matrix
Date: Mon, 21 Sep 2015 11:49:08 +0530

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?

Shamika


reply via email to

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