feat: Add partial second lab

This commit is contained in:
2024-03-27 10:39:23 +01:00
parent 5391eda232
commit aba7e87114
2 changed files with 36 additions and 0 deletions

25
Lab02.m Normal file
View File

@@ -0,0 +1,25 @@
s = tf('s');
%% 1
H = 1/(s*(s+2)*(s+4));
generatePlots(H)
%% 2
H = -0.1*(1-2*s)/(s*(s+0.2)*(s+1));
generatePlots(H)
%% 3
H = 1/(s*s*(s+3));
generatePlots(H)
%% 4
H = 2*(1+0.5*s)/((1+s)*(1-s)^2);
generatePlots(H)
%% 5
H = (s*s+1)/((s-2)*(s+2)*(s+4));
generatePlots(H)
%% 7
H = (s-2)/((2+s)*(s*s+1));
generatePlots(H)

11
generatePlots.m Normal file
View File

@@ -0,0 +1,11 @@
function generatePlots(H)
subplot(1,2,1)
plotoptions = bodeoptions;
plotoptions.Grid = 'on';
%plotoptions.FreqScale = 'linear';
bodeplot(H,plotoptions)
subplot(1,2,2)
[num, den] = tfdata(H, "v");
nyquist(num,den)
grid on
end