Does cmath operate on arrays?
Does cmath operate on arrays?
(OP)
Hello,
In Matlab I can do in one line: c=a+j*b where j=sqrt(-1) and a,b,c are arrays.
Can I do this in python using cmath?
Thanks
Robert
In Matlab I can do in one line: c=a+j*b where j=sqrt(-1) and a,b,c are arrays.
Can I do this in python using cmath?
Thanks
Robert
RE: Does cmath operate on arrays?
The thing is that you don't need cmath for what you want to do, all you need are numpy arrays; you operation would than look like this:
c = a + b*1j
j is already defined in python and it can be best used with the accompanying 1, i.e., "1j"