I am trying to multiply real part of a complex number to a scalar while the imaginary part stay the same.
For example x= a + bi
after multiplying to c
result us y= ca + bi
.
Any suggestions on procedure?
For this you can use the real
and imag
functions in MatLab. So the multiplication becomes:
y = real(x) * c + imag(x)*i
real
(see documentation ) retrieves a
from x
and imag
(see documentation ) retrieves b
from x
. Don't forget to multiply with i
again ;)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.