I don't understand accumarray behaviour when passed complex numbers. I expect accumarray([1 1]', [1i 2i]') to behave like sum([1i 2i]) (for this particuar case).
It however returns 0.0000 - 3.0000i instead of 0.0000 + 3.0000i.
I don't understand accumarray behaviour when passed complex numbers. I expect accumarray([1 1]', [1i 2i]') to behave like sum([1i 2i]) (for this particuar case).
It however returns 0.0000 - 3.0000i instead of 0.0000 + 3.0000i.
Copyright © 2021 Jogjafile Inc.
You mixed up your operators.
'is the complex conjugate transpose. Use.'to do a regular transpose. So you're doingsum([-1i; -2i])which is indeed-3i. Callingaccumarray([1 1].', [1i 2i].'), mind the dots, gives0.0000 + 3.0000i.See also Why is complex conjugate transpose the default in Matlab