📄 examp19.m
字号:
clc,echo on
%EXAMPLE 19
RHS=[1 0 0];LHS=[1 0 -0.64]; % RHS and LHS of difference eq
X=[20 0.8 0 0 0 0]; IC=[5;25]; % Input and Initial conditions
[yt,yzs]=sysresp1('z',RHS,LHS,X,IC) % symbolic response
h=sysresp1('z',RHS,LHS) % symbolic impulse response
n=0:30; % DT Index to evaluate sysresp1 output
dtplot(n,eval(yt),'o'),pause(2) % Evaluate response and plot
dtplot(n,eval(h),'o'),pause(2) % Evaluate and plot impulse response
%
xin=20*(0.8 .^ n); % input array for DTSIM
ytd=dtsim(RHS,LHS,xin,IC); % Numerical response
yzsd=dtsim(RHS,LHS,xin); % Numerical zero-state response
hd=dtsim(RHS,LHS,udelta(n)); % Numerical impulse response
dtplot(n,ytd,'o'),pause(2) % Plot numerical response
dtplot(n,hd,'o') % Plot numerical impulse response
echo off %end of example
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -