% Optical Imaging and Spectroscopy
%
% David J. Brady
% Duke University
% www.opticalimaging.org
%
%
function qr=qres(p)
% qres generates a list of p-1 elements with value 1 for quadratic residues
% of p and 0 for non residues
qr=zeros(1,p-1);
for i=1:(p-1)
    qr(mod(i^2,p))=1;
end
