How to plot magnitude response using $\tt freqz$ in MATLAB if I have a transfer function without a denominator
You simply specify a = 1 (because the denominator equals $1$). So you get


b = [1,sqrt(2),1];
a = 1;
N = 512;
[H,w] = freqz(b,a,N);


You can compare this to the analytical solution:


H2 = 1 + sqrt(2)*exp(-1i*w) + exp(-1i*2*w);
max(abs(H2-H))    % 8.0825e-16