⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sinc.m

📁 很多matlab的源代码
💻 M
字号:
function y = sinc(x)
% SINC Sinc Function.
%
%      Y=SINC(X) generates sin(pi*x)/(pi*x)
%
%      SINC (with no input arguments) invokes the following example:
%
%        % Evaluate and plot sinc(2t-1) from -3 to 3
%        >>t=-3:0.02:3;ys=sinc(2*t-1);plot(t,ys),grid


% ADSP Toolbox: Version 2.0 
% For use with "Analog and Digital Signal Processing", 2nd Ed.
% Published by PWS Publishing Co.
%
% Ashok Ambardar, EE Dept. MTU, Houghton, MI 49931, USA
% http://www.ee.mtu/faculty/akambard.html
% e-mail: akambard@mtu.edu
% Copyright (c) 1998


if nargin==0,help sinc,disp('Strike a key to see results of the example')
pause,t=-3:0.02:3;ys=sinc(2*t-1);
 v=matverch;
 if v < 4, eval('clg');else,eval('clf');end

plot(t,ys),grid,return,end


%x=pi*x;i=find(x==0);
%[m,n]=size(i);x(i)=ones(m,n);
%y=sin(x)./x;y(i)=ones(m,n);

%New from the Mathworks
y=ones(size(x));
i=find(x);
y(i)=sin(pi*x(i))./(pi*x(i));

⌨️ 快捷键说明

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