If by symmetry you mean fewer points but closer to the line, then reduce the number of query points, or points in the line:
xvals = linspace(-5,5,1*n);
Then, use dsearchn like this:
The points you are looking for are in k, as shown below:
plot(P(k,1), P(k,2),'or', 'markerfacecolor', 'r');
Here's the result with only n/2 points in the line:
You could also try using a finer granularity in the grid, but I haven't explored that.