% BodeExample.m clc; clear all; close all; s = tf('s'); N = 1 + s; D = 1 + 2*s; T = N/D; w = linspace(0,4,100); % divide the range from 0 to 4 in 100 points opts = bodeoptions('cstprefs'); opts.Title.FontSize = 16; opts.Title.Color = 'b'; opts.Xlabel.FontSize = 14; opts.Ylabel.FontSize = 14; opts.TickLabel.FontSize = 12; opts.PhaseVisible = 'on'; opts.Grid = 'on'; opts.GridColor = 'g'; opts.FreqUnits = 'Hz'; % opts.FreqUnits = 'kHz'; % opts.FreqUnits = 'MHz'; % opts.FreqUnits = 'GHz'; % opts.MagUnits = 'abs'; bodeplot(w,T,opts); set(findall(gcf,'type','line'),'linewidth',1) % In case you are not satisfied with the default Bode % plot's appearance you can always customize it figure; subplot(2,1,1); s=tf('s'); N = (1 + s); D = (1 + 2*s); T = N/D; w = logspace(-2,3,100*5); % use 100 points per decade (range 10^-2 to 10^3) f = w/2/pi; [mag, phase] = bode(T,w); M = squeeze(mag); semilogx(f, M,'linewidth', 2); grid on; xlabel('freq. [Hz]', 'fontsize', 16) ylabel('Magnitude', 'fontsize', 16); title('Bode Plots','fontsize',18); subplot(2,1,2); angle = squeeze(phase); semilogx(f,angle, 'linewidth', 2); grid on; xlabel('freq. [Hz]', 'fontsize', 16) ylabel('Phase [deg]', 'fontsize', 16);