# Bode plot display in matlab

I would like to display a bode plot of a buck-boost converter using Matlab, so I got the figure shown below, If we look closer to the phase plot, we see that it starts from 360°. My wish is to make the graph starts from 0° rather than 360° in order to make the reading easier to me.

• What should I do to make the phase plot starts from 0° ?
• Another question is how can I display the gain at a desired crossover frequency in the graph ?

• What was the dynamic system model you used? Do you use the Control System Toolbox, and if so, which command (bode, bodeplot) did you use to plot the bode diagram?
– Hufi
Jun 5, 2020 at 19:55
• Sometimes I use bode(sys,options) command, and sometimes I use margin(sys). In this display, I have used margin(sys) command. But in both cases I get the phase plot starts from 360° rather than 0° Jun 5, 2020 at 20:05

A possible solution would be to use bodeplot and then change the PhaseMatchingValue property. As an example, I use $$\H(s)=\frac{s^4+1}{s+1}\$$:

sys = tf([1 0 0 0 1],[1 1]);
h = bodeplot(sys);
p = getoptions(h);
p.PhaseMatching = 'on';
p.PhaseMatchingFreq = 1;
p.PhaseMatchingValue = 0;
setoptions(h,p);


This results in the following bode diagram

Another (not very elegant) solution using the command bode

sys = tf([1 0 0 0 1],[1 1]);
wout = logspace(-2,2,201);
[mag,phase,wout] = bode(sys,wout);
wout = squeeze(wout);
mag = squeeze(mag);
phase = squeeze(phase);