📄 f_funx.asv
字号:
function x = f_funx (t,xm,userinput,X)
%F_FUNX: Compute a selected input signal
%
% Usage: x = f_funx(t,xm,userinput);
%
% Inputs: t = evaluation time
% xm = input mode
% userinput = a string specifying the name of a user
% defined function: x = userinput(t)
% X = p by 2 array containing breakpoints for
% piecewise linear input (optional)
%
% Outputs: x = value of input signal at time t
%
% Note: Used by f_plotsamp, and f_plotrec
x = 0;
switch xm
case 0, % piecewise linear (used by
p = size(X,1); % Butterworth)
dx = (X(p,1)-X(1,1))/(p-1);
k = 1 + floor((t - X(1,1))/dx);
k = max(1,min(p,k));
x = X(k,2);
case 1,
x = ones(size(t));
case 2,
x = exp(-t);
case 3,
x = cos(2*pi*t);
case 4,
x = sign(sin(2*pi*t));
case 5,
x = feval(userinput,t);
end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -