c6ex7.m
来自「数字信号处理Matlab实现?中藕糯鞰atlab实现数字信号处理Matlab」· M 代码 · 共 13 行
M
13 行
% lsim plot for Example 6-7%v0 = -2; % Define IC valuet = 0:.05:40; % Define time variablenum = [1 0];den = [1 1]; % Define H(s) numerator and denominator polynomialsv = 5*cos(2*t)-v0; % Define input in time domain; include ICy_sim = lsim(num, den, v, t); % Use lsim( ) to get output (without y = lsim( ), plot is done)y_anal = (1-v0)*exp(-t)+4*(cos(2*t)-.5*sin(2*t)); % Analytical output for comparison% Plot simulated and analytically computed outputsubplot(2,1,1),plot(t, y_sim), xlabel('t'), ylabel('sim. y(t)')subplot(2,1,2),plot(t, y_anal), xlabel('t'), ylabel('anal. y(t)')
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?