Skip to content

Instantly share code, notes, and snippets.

Created March 2, 2013 05:56
Show Gist options
  • Save anonymous/5069874 to your computer and use it in GitHub Desktop.
Save anonymous/5069874 to your computer and use it in GitHub Desktop.
script for matlab
a1 = 6.82;
a2 = 4.93;
a3 = -6.515;
a4 = -5.382;
system = tf(1, [1 a1 a2 a3 a4]);
figure;
nyquist(system);
figure;
bode(system);
figure;
impulse(system);
figure
Re = [];
Im = [];
for w=0:0.01:1.1
Njw = ((w*i)^4) + a1*((w*i)^3) + a2*((w*i)^2) + a3*(w*i) + a4;
Re1 = real(Njw);
Im1 = imag(Njw);
Re = [Re,Re1];
Im = [Im,Im1];
end
ax = axes;
plot(Re, Im);
set(ax, 'XGrid', 'on', 'YGrid', 'on');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment