realpart(expression)
and imagpart(expression)
is used to decompose complex expressions. Symbolic variables
in these expressions are assumed to be real-valued.
>> syms x >> y=(3+i*x)/(2-i*x) y = (-x+3i)/(x+2i) >> realpart(y) ans = (-x^2+6)/(x^2+4) >> imagpart(y) ans = 5*x/(x^2+4)