필터 지우기
필터 지우기

Assign value to individual components of the complex number

조회 수: 2 (최근 30일)
Jack Daniels
Jack Daniels 2022년 11월 4일
댓글: Matt J 2022년 11월 7일
I'd like to assign the value to individual components of the complex numer.
>> x = 1;
>> y = 1;
>> H = complex(x,y);
Now I'd like to change the only real part and only the imaginery part
pseudocode: H.real = 10;
pseudocode: H.imag = 10;
and expecting
pseudocode answer: H = 10+10i
How to do it in Matlab?

답변 (1개)

Matt J
Matt J 2022년 11월 4일
H=complex(10,imag(H))
H=complex(real(H),10)
  댓글 수: 8
Matt J
Matt J 2022년 11월 7일
You're quite welcome, but if you are happy with the answer, please Accept-click it.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Logical에 대해 자세히 알아보기

제품


릴리스

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by