compex vector in 'C' -> complex vector in 'octave'
Sergei Steshenko
sergstesh at yahoo.com
Thu Apr 24 13:14:07 CDT 2008
Hello All,
supposed I have a complex vector generated by a 'C' program and dumped in binary form into a file
using 'fwrite'.
So, the data will put into the file this way:
re[0], im[0], re[1], im[1], ... re[N-1], im[N-1]
where N is number of elements in the vector.
I can load the vector into octave using 'fread', but, I quess, it will look like vector
of real numbers.
I can take data at indexes 1, 3, 5... (the real parts) and at indexes 2, 4, 6 ... (the imaginary
parts) and "reconstitute" the vector, but maybe there is a handy function which already does
this ?
I read
http://www.gnu.org/software/octave/doc/interpreter/Rearranging-Matrices.html#Rearranging-Matrices
but could come up with anything more elegant than the straightforward odd-even indexes solution.
Thanks,
Sergei.
Applications From Scratch: http://appsfromscratch.berlios.de/
____________________________________________________________________________________
Be a better friend, newshound, and
know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
More information about the Help-octave
mailing list