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

 채택된 답변

Torsten
Torsten 2019년 6월 13일

1 개 추천

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

댓글 수: 3

Sylvain Rousseau
Sylvain Rousseau 2019년 6월 13일
편집: Sylvain Rousseau 2019년 6월 13일
Many Thanks Torsten, it works fine.
Though, I don't understand why it does work.
Cheers
Torsten
Torsten 2019년 6월 13일
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

질문:

2019년 6월 13일

댓글:

2019년 6월 13일

Community Treasure Hunt

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

Start Hunting!

Translated by