function y = sinc(x)
% DESCRIPTION:
%       Mathematical sinc function.
%
% USAGE:
%       y = sinc(x)
%
% ABOUT:
%       author: Bradley E. Treeby
%       date: 14th January 2009
%       last update: 28th May 2009
%       
% This function is part of the k-Wave Toolbox (http://www.k-wave.org)

warning('off', 'MATLAB:divideByZero');
y = sin(x)./x;
y(x == 0) = 1;