matlab - How do I make complex int16 numbers in octave? -
in matlab (my version happens r2010b) 1 can convert complex double complex int16 type so:
>> = 8.3+4.9j; >> ai16 = int16(a) ai16 = 8 + 5i >> whos ai16 name size bytes class attributes ai16 1x1 4 int16 complex
i.e. ai16 complex int16 type (equivalent c++ complex< short > example).
octave (ver 4.0.0) not 1 bit:
>> ai16 = int16(a) error: invalid conversion complex scalar int16 scalar
i trying port legacy matlab code octave. have suggestion on how around in painless way? thought of this:
ai16.real = int16(real(a)); ai16.imag = int16(imag(a));
but propagate lot of pain through out code base. there many arrays have been converted complex double complex int16. , these arrays used in many computations.
Comments
Post a Comment