【问题标题】:multiplying real part of a complex number while imaginary part stay tact (Matlab)将复数的实部相乘,而虚部保持不变(Matlab)
【发布时间】:2014-07-21 22:07:51
【问题描述】:

我试图将复数的实部乘以标量,而虚部保持不变。

例如x= a + bic 相乘后得到y= ca + bi

对程序有什么建议吗?

【问题讨论】:

  • y=real(x)*c+imag(x)?
  • 不。没用。 h = 1 + 2i >> y=real(h)*2+imag(h) y = 4
  • 在我的回答中,不要忘记将 imag(x) 与 'i' 相乘!
  • 你确定吗?我试过了,但它没有给我我写的正确表格。
  • 是的,我确定:h = 1 + 2 * i >> y = real(h) * 2 + imag(h) * i(y = 2 + 2 * i

标签: matlab math linear-algebra complex-numbers


【解决方案1】:

为此,您可以使用 MatLab 中的 realimag 函数。所以乘法变为:

y = real(x) * c + imag(x)*i

real(参见documentation)从x 中检索aimag(参见documentation)从x 中检索b。不要忘记再次与i 相乘;)

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-01-08
    • 2015-05-24
    • 1970-01-01
    • 2014-08-26
    • 1970-01-01
    相关资源
    最近更新 更多