Matlab frequency response
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$

There is some output scaling issue. But since you are getting the same curve, you are just messing some constants is all.

please try $\text{plot}(w,z)$