フィルターのクリア

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 件のコメント
Jack Daniels
Jack Daniels 2022 年 11 月 7 日
Great! Thank you!
Matt J
Matt J 2022 年 11 月 7 日
You're quite welcome, but if you are happy with the answer, please Accept-click it.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeLogical についてさらに検索

製品


リリース

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by