mor.bode
Main interface for Bode plot.
mor.bode(sys,W)
mor.bode(sys,color,W)
mor.bode(sys,color,W,tag)
H = mor.bode(sys,W)
mor.bode(sys,W)
plots the Bode diagram of sys
over the frequencies defined by the vector W
. The input sys
can either be
sys = ss(A,B,C,D)
(or sys = dss(A,B,C,D,E)
) sys = {A,B,C,D}
(or sys = {A,B,C,D,E}
)sys = {w_i,H_i}
sys = @(s) myFun
mor.bode(sys,color,W)
plots sys
with color color
.H = mor.bode(sys,W)
provides the frequency response ny outputs, nu inputs, N values vector.
sys | Dynamical system or input-output data. More specifically sys can either be
|
color | Color in a string tag or a RGB vector. |
W | Vector of frequencies, in rad/s, over which the system's frequency responses are evaluated (positive real vector). |
tag | Optional term being either: 'phase' to plot the phase diagram, 'abs' to plot the Bode response in absolute scale. |
H | Returns the frequency response of the dynamic system model sys (model, data, handle function) at frequencies W (complex ny x nu x N vector). |
% Bode from state-space
sys = ss(zpk([],[-0.1+3*1i,-0.1-3*1i,-0.05+10*1i,-0.05-10*1i,-0.01+20*1i,-0.01-20*1i],1));
W = logspace(-1,3,300);
figure
mor.bode(sys,W)
% Bode from matrices
load build
A = G.a;
B = G.b;
C = G.c;
D = G.d;
W = logspace(-1,3,300);
figure
mor.bode({A,B,C,D},W)
% Bode from freqresp function
load build
sys = G;
W = logspace(-1,3,300);
H = freqresp(sys,W);
figure
mor.bode({H},W)
% Bode from handle function
sys = @(s) 1/(s^2+.1*s+1);
W = logspace(-1,3,300);
figure
mor.bode(sys,W)