The example code for gmres with preconditioner has bug: the relative residual to plot from resvec should be resvec/norm(preconditioner\b), not resvec/norm(b).
A simple check is the relative residual should be 1 when interation = 0, since norm(Ax-b)/norm(b) = norm(b)/norm(b) = 1.
Best Answer