vatlab / sos-matlab

SoS extension for Matlab and Octave
BSD 3-Clause "New" or "Revised" License
2 stars 3 forks source link

Complex valued arrays fail to evaluate in SoS #10

Closed fghorow closed 4 years ago

fghorow commented 4 years ago

Using either a %get from SoS or a %put from matlab of a complex valued (1D) matlab array fails with the message:

Failed to evaluate 'np.array([128,-0.99999976158142089844+81.48323822021484375i,...

The problem is that matlab has formatted the imaginary part of a complex number using 'i' as the imaginary unit, but Python requires a formatting with 'j' for the imaginary unit.

There are workarounds if I knew how to grab hold of the actual string representation, but a) I'm a newbie with SoS and don't know how to do that, and b) this is a clear bug that will affect other users of SoS.

BoPeng commented 4 years ago

Thanks for the report. I think for single complex numbers sos handles correctly but you have array of complex numbers, which is not currently supported. Let me have a look.

BoPeng commented 4 years ago

Fixed and released sos-matlab 0.18.5.

fghorow commented 4 years ago

Yes, that fixed the problem. Thanks for the quick response!