Reputation: 183
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?
Upvotes: 1
Views: 1217
Reputation: 1189
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 ;)
Upvotes: 3