octave_read_complex

Jonathan Stickel jjstickel at vcn.com
Tue Feb 5 09:03:41 CST 2008


I would like to read a complex number from a string in an oct-file 
function.  Below is the relevant code and output for the complex number 
string.

   ComplexMatrix data;
   istringstream strstrm;
(loop)
   data(i,j) = octave_read_complex(strstrm);
   cout << strstrm.str() << " " << data(i,j) << "\n";
(end loop)

output:
  1+1i (1,0)

Why isn't the complex number being read correctly?

Thanks,
Jonathan


More information about the Help-octave mailing list