MATLAB: Is there a function that returns the real root from a matrix that contains the roots of a function

function

i want to return the real root from a vector contains the roots of a function, this vector contains both imaginary and real roots

Best Answer

If R is the vector of roots, then
R(imag(R) == 0)