I noticed a confused computation of complex valued multiplication in Matlab. One simple example is as below:
syms x1 x2 x3 x4
s=[x1 x2]*[x3 x4]'
And the return value of s is like:
s=x1*conj(x3) + x2*conj(x4)
In my opinion s should be equal to x1*x3+x2*x4. So, what’s the problem here?
Then, how should I do if I want to get a multiplication of two complex vector?
update: I find out it will be solved through using .’ rather than . like:
s=[x1 x2]*[x3 x4]
The operator
'is the also called Complex conjugate transpose in Matlabctranspose, which basically means that it appliesconjand andtransposefunctions. Note that this operator is call Hermitian operator in mathematics.What you actually want is the operator
transposethat is shortcut as.'In order to get the expected output, and given that you just want to multiply without conjugating the second vector, you should do:
so your output will be:
For further information you can check
help ., to see the list of operators,help transposeandhelp ctranspose