Matlab frequency response

I'm trying to make a frequency response of that function:

d=[1 -0.494 0.6404];
p=[1 1.58567330897 0.96];
[h,w] = freqz(p,d,40000);
z = abs(h);
plot(w/pi,z);


d and p i calculated. The plot gives me this:

but in book has that answer:

as you can see the peak of magnitude is 2 and not about 6.5. '-' What am I doing wrong? H2 has an abs 1 because it is a all pass filter.

Your answer is correct. Please note that your graph is in the range $$0$$ to $$1$$ while the graph in the text is in the output range of $$-\pi$$ to $$+\pi$$
please try $$\text{plot}(w,z)$$