You could probably take the real and imaginary parts after replacing with s=j*w . However, you can choose the even and odd parts of your polynomials:
% G(s) = N(s)/D(s); syms s; N = s^3+4*s^2-s+1; p = sym2poly(N); %// do this in fewer lines: %{ /* if mod(length(p),2)==0 %// then first index is odd imin_o = 1; %// for odd part imin_e = 2; %// for even part else imin_o = 2; %// for odd part imin_e = 1; %// for even part end */ %} imin_o = mod(length(p),2) + 1; imin_e = 2 - mod(length(p),2); % odd part of numerator p_o = zeros(size(p)); p_o(imin_o:2:end) = p(imin_o:2:end); % even part of numerator p_e = zeros(size(p)); p_e(imin_e:2:end) = p(imin_e:2:end); % restore N_o = poly2sym(p_o,s); N_e = poly2sym(p_e,s);
and the same for the denominator.
source share