📄 c6ex7.m
字号:
% 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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -