1.In attached code
r = r(isreal(r)&real(r)>=0)
Is equivalent of following two line but result getting changed
r = r(imag(r)==0); % Remove imaginary root
r =r((r)>=0); % Remove negative real root
2. If we remove for i=1:length(a), then k will be a vector and getting its plot may difficult.
3.In attached fig, cupper colour show zone of 3 real positive roots while black colour show zone having only one real positive roots. Is it not possible to make black colour zone i.e zone having only one real positive root as white or colorless?