sinc.m

来自「有关matlab的电子书籍有一定的帮助希望有用」· 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) 1988-98 by The MathWorks, Inc.
%       $Revision: 1.9 $  $Date: 1997/11/26 20:13:12 $

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

⌨️ 快捷键说明

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