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

📄 udelta.m

📁 很多matlab的源代码
💻 M
字号:
function y = udelta(n,ty)
% UDELTA Unit Impulse Function.
%
%        Y=UDELTA(N) implements the Discrete-Time impulse function d[n]
%
%	 Y=UDELTA(N,ty) implements the CT impulse (n=0) or its nth derivative
%	 NOTE: ty=ORDER: (ty=0 for impulse, ty=1 for doublet etc.
%	 The CT impulse and derivatives are undefined at t=0, zero otherwise.
%	 USAGE: Use the CT form with ILT for plotting Inv. Laplace Transforms.
%
%        UDELTA (with no input arguments) invokes the following example:
%
%        >>n=-5:5;
%        >>yd=udelta(n-2);   % DT impulse d[n-2]
%        >>dtplot(n,yd,'o')
%
%        See Also: URAMP, URECT, USTEP, TRI


% 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 udelta
 disp('Strike a key to see results of the example')
 pause
 n0=-5:5;
 yd=udelta(n0-2);
 v=matverch;
 if v < 4, eval('clg');else,eval('clf');end
 axis([-5 5 0 1.5])
 dtplot(n0,yd,'o')
 axis([-5 5 0 1.5])
 hold off
 return
end

y=(n==0);
if nargin>1
i=find(y==1);
l=length(i);
if l>0
y(i)=nan*ones(1,l);
end
end

⌨️ 快捷键说明

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