0% found this document useful (0 votes)
2 views2 pages

% Program For Bode Plot

The document contains a MATLAB program for generating a Bode plot of a transfer function defined by a numerator and denominator. It specifies a frequency range and calculates the gain and phase margins along with crossover frequencies. The program also includes commands for plotting and formatting the Bode plot.

Uploaded by

kiwifruit070
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views2 pages

% Program For Bode Plot

The document contains a MATLAB program for generating a Bode plot of a transfer function defined by a numerator and denominator. It specifies a frequency range and calculates the gain and phase margins along with crossover frequencies. The program also includes commands for plotting and formatting the Bode plot.

Uploaded by

kiwifruit070
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

% Program for Bode Plot

clc;
clear;
num=[50];
den=[1 9 30 40];
sys=tf(num,den);
w=logspace(-1,5,1000); % Specify Frequency range
bode(sys,w);
margin(sys);
grid on;
xlabel('Frequency')
ylabel('Phase angle in degrees')
title('Bode Plot of system (50/s^3+9s^2+30s+40)')
[Gm, Pm, Wcp, Wcg]=margin(sys) % Finding Gain and Phase Margins and
%Gain & Phase Crossover Frequencies

OUTPUT MATLAB:
OUTPUT OCTAVE:

You might also like