matrix vector multiplication complex number

Hi,
A complex matrix - vector mutiplication yields to a wrong result.
Heer is the code :
M = [ 1 complex(1,1) ; complex(0,-1) 1 ; 2 0; -1 3]
b = [ 2 complex(1,-1)]';
y=M*b
The outcome obtaind manually is : [ 4 1-3*i 4 1-3*i]
The matlab result (which is wrong) : [ 2+2*i 1-1*i 4 1+3*i]
May I ask you some hints please ?
Regards
Sylvain

 采纳的回答

b = [ 2 ,complex(1,-1)].'
instead of
b = [ 2 ,complex(1,-1)]'

3 个评论

Many Thanks Torsten, it works fine.
Though, I don't understand why it does work.
Cheers
b = [ 2 ,complex(1,-1)].'
means that you take the transpose of the vector which gives
b = [2; complex(1,-1)]
b = [ 2 ,complex(1,-1)]'
means that you take the conjugate transpose of the vector which gives
b = [2; complex(1,1)]
Many thanks Torsten.
Here is the corresponding doc link : https://fr.mathworks.com/help/matlab/ref/ctranspose.html

请先登录,再进行评论。

更多回答(0 个)

类别

帮助中心File Exchange 中查找有关 Creating and Concatenating Matrices 的更多信息

产品

版本

R2014a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by