Frequency response given poles and zeros I'm trying to plot the frequency response $H(z)$ of given zeros/poles using the following code in MATLAB:

z=[0.36545+0.88446i; 0.01-0.1057i;]
p=[-0.46016+0.87251i; -0.37649-0.94861i;]
[num, den]=zp2tf(z,p,K)
[h,w]=freqz(num,den)
plot(w,abs(h))   


But it appears it doesn't work correctly when the coefficients of the transfer function $H(z)$ are complex. And it gives a different response compared to the expected response. 

This is the expected transfer function: 
    $$H(z)=\frac{1+(-1.3745-0.77689i)z^{-1}+(0.46331+0.85406i)z^{-2}}{1+       (0.83665-0.023904i)z^{-1}+(0.91366+0.061999i)z^{-2}}$$
The MathWorks Documentation of the function zp2tf says that


  The zeros and poles must be real or come in complex conjugate pairs.


which is not the case for your example. With the given values of the vectors z and p you can do the following:


num = poly(z);
den = poly(p);


which gives

1.00000 + 0.00000i  -0.37545 - 0.77876i   0.09714 - 0.02978i

for num, and

1.00000 + 0.00000i   0.83665 + 0.07610i   1.00092 + 0.10802i

for den. Note that these are different from the coefficients of your 'expected transfer function'. However, these coefficients correspond to the given pole and zero locations.

Also note that one of your poles lies outside the unit circle, so your filter is unstable.