📄 uramp.m
字号:
function y=uramp(t)
% URAMP Unit Ramp Function.
%
% Y=URAMP(t) implements the ramp function r(t) = t*u(t)
%
% URAMP (with no input arguments) invokes the following example:
%
% % Plot a triangle between -1 and 1 with height 2
% >>t=-3:.05:3;
% >>yt=2*[uramp(t+1)-2*uramp(t)+uramp(t-1)];
% >>plot(t,yt),grid
%
% See Also: UDELTA, 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 uramp
disp('Strike a key to see results of the example')
pause
t0=-3:.05:3;
yt=2*[uramp(t0+1)-2*uramp(t0)+uramp(t0-1)];
v=matverch;
if v < 4, eval('clg');else,eval('clf');end
plot(t0,yt)
grid
return
end
if nargin == 1,
y=t.*(t>=0);
elseif nargin > 1,
error('Too many input arguments');
end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -