Use 'roots' to find the roots of polynomials.
r = roots([1,7,-8,5,1]);
r = r(imag(r)==0);
The 'isreal' function is true only if All elements of a vector are real, so it isn't appropriate for sorting out the real roots.
A polynomial with all real coefficients such as yours cannot have an odd number of complex roots. They must occur in conjugate pairs. As you see, in your particular polynomial there are just two complex roots, which are conjugates of one another.
Best Answer