function y = sinc(x) % % SINC % The function y=sinc(x) returns the value of sin(x)/x evaluated % for each element in the vector x. If x is a scalar, a single % argument is returned. Note that a factor of Pi is NOT included % in this implementation of the sinc function and that sinc(0) = 0. % % RJM 10/17/94 % x=x(:); y=sin(x)./x; [n,m]=find(x==0); for i=1:length(n), y(n(i),m(i))=1; end %sprintf('The Divide by Zeros Have Been Corrected.\n')