MATLAB: How to eliminate or exclude complix numbers from an array solution

eliminat complix numbersexclude complix numbers form solution

Hello everyone,
Is there any way to eliminate the complex numbers (real and imaginary parts) from a array solution. Or can I exclude the complex elements so the solution will just include the real numbers. For example, in the next array I just want the real elements ( the first four elements. Thanks for any suggestion.
sol =
2.7081096834177947291918098879734
2.4539692532957056897462100829847
1.1392825187840759291489282043638
-4.0494620185638170836265057842329
0.88295725432536163128309307530013 - 0.1308999971886537594046901453934*i
0.1308999971886537594046901453934*i + 0.88295725432536163128309307530013
0.1528510148755374525528985048959*i - 2.0089069727922412635133142708447
- 0.1528510148755374525528985048959*i - 2.0089069727922412635133142708447

Best Answer

sol = sol(sol==real(sol));
Related Question