help-octave
[Top][All Lists]
Advanced

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

Re: Imaginary values in Complex Matrix


From: siko1056
Subject: Re: Imaginary values in Complex Matrix
Date: Mon, 21 Sep 2015 09:16:36 -0700 (PDT)

To get help faster, please post complete, but meaningfully short code
snippets like below. Here is a version that should work for you. It creates
an immediate Complex number.

#include <octave/oct.h>

DEFUN_DLD (myoct, args, , "Blah")
{
  octave_value_list retval;

  ComplexMatrix matr = ComplexMatrix (2,2);
  for (int r=0;r<2;r++)
    {
    for(int c=0;c<2;c++)
      {
      Complex cc(r,c);
      matr(r,c) = cc;
      }
    }
  retval(0) = octave_value (matr);
  std::cout << retval(0).complex_matrix_value()<< std::endl;
  return retval;
}

HTH, Kai



--
View this message in context: 
http://octave.1599824.n4.nabble.com/Imaginary-values-in-Complex-Matrix-tp4672638p4672639.html
Sent from the Octave - General mailing list archive at Nabble.com.



reply via email to

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