Home > wafo > misc > sinc.m

sinc

PURPOSE ^

Sin(pi*x)/(pi*x) function.

SYNOPSIS ^

y = sinc(x)

DESCRIPTION ^

 SINC Sin(pi*x)/(pi*x) function. 
  
   CALL:  y = sinc(x); 
  
     y = sin(pi*x)/(pi*x)    if x ~= 0 
       = 1                   if x == 0 
  
  Example:  
   x =linspace(-5,5)';  
   plot(x,sinc(x)) 
  
  See also  sin

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

01 function y = sinc(x) 
02 %SINC Sin(pi*x)/(pi*x) function. 
03 % 
04 %  CALL:  y = sinc(x); 
05 % 
06 %    y = sin(pi*x)/(pi*x)    if x ~= 0 
07 %      = 1                   if x == 0 
08 % 
09 % Example:  
10 %  x =linspace(-5,5)';  
11 %  plot(x,sinc(x)) 
12 % 
13 % See also  sin 
14  
15 %Tested on: Matlab 5.3 
16 %History: 
17 % by pab 05.04.2001 
18  
19 y = ones(size(x)); 
20 k = find(x~=0); 
21 if any(k); 
22   xk = pi*x(k); 
23   y(k) = sin(xk)./(xk); 
24 end 
25  
26  
27

Mathematical Statistics
Centre for Mathematical Sciences
Lund University with Lund Institute of Technology

Comments or corrections to the WAFO group


Generated on Thu 06-Oct-2005 02:21:16 for WAFO by m2html © 2003