How to determine real part of a symbolic complex number

6 views (last 30 days)
hi..if i have a symbolic complex number like S=1+w*i . How do i get only the real part of it? i test it with "real" command, but it doesnt help..it shows (-imag(w))

Answers (1)

Walter Roberson
Walter Roberson on 6 May 2020
it would have showed 1-imag(w)
This is a correct calculation, because you did not tell matlab that w is real valued.
syms w real

Community Treasure Hunt

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

Start Hunting!