Remove Operations in a Vector

조회 수: 2 (최근 30일)
John
John 2013년 10월 7일
댓글: A Jenkins 2013년 10월 7일
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

채택된 답변

A Jenkins
A Jenkins 2013년 10월 7일
  댓글 수: 4
Jan
Jan 2013년 10월 7일
real(x) + imag(x)
A Jenkins
A Jenkins 2013년 10월 7일
i is the imaginary unit, sqrt(-1). Your answers are complex numbers, so it wouldn't really make sense to set i to 1.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by