sinc.m

来自「这是一个 York大学开发的FDTD代码。很好用的工具」· M 代码 · 共 17 行

M
17
字号
function y=sinc(x)
%SINC	Sin(pi*x)/(pi*x) function
%	SINC(X) returns a matrix whose elements are the sinc of the elements 
%	of X, i.e.
%	     y = sin(pi*x)/(pi*x)    if x ~= 0
%	       = 1                   if x == 0
%	where x is an element of the input matrix and y is the resultant
%	output element.  

%	Author(s): T. Krauss, 1-14-93
%	Copyright (c) 1984-94 by The MathWorks, Inc.
%       $Revision: 1.4 $  $Date: 1994/01/25 17:59:49 $

y=ones(size(x));
i=find(x);
y(i)=sin(pi*x(i))./(pi*x(i));

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?