Remove Operations in a Vector

I have a function whose output is a vector. Each value in the vector contains + or - operation as below.
5.39616521085160 + 0.00000000000000i
9.07848311879947 + 0.00000000000000i
18.6990064418951 - 0.609255622508561i
26.0039095870120 - 0.440617301529825i
34.9180935616170 - 1.38243566324103i
39.6501427984753 - 1.20885046059516i
How can I remove the operation sign and the values after the operations sign to get
5.39616521085160
9.07848311879947
18.6990064418951
26.0039095870120
34.9180935616170
39.6501427984753
Thanks

 Accepted Answer

real(x)

4 Comments

Awesome...Thanks
Just a followup question, assuming i=1, if I want to execute the operation in each row, how can I do it? Thanks for your help
real(x) + imag(x)
i is the imaginary unit, sqrt(-1). Your answers are complex numbers, so it wouldn't really make sense to set i to 1.

Sign in to comment.

More Answers (0)

Categories

Find more on Programming in Help Center and File Exchange

Asked:

on 7 Oct 2013

Commented:

on 7 Oct 2013

Community Treasure Hunt

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

Start Hunting!