FUNCTION REFERENCE
bode
Magnitude and unwrapped phase of an LTI frequency response.
Magnitude and unwrapped phase of an LTI frequency response.
Syntax
[mag,phase,w] = bode(sys[,w])Syntax
bode(sys1[,LineSpec1],sys2[,LineSpec2],...[,w][,Name,Value,...])mag is absolute amplitude and phase is unwrapped degrees. Returned arrays have dimensions outputs by inputs by frequencies (1x1xN for SISO). Without outputs, plots magnitude in dB above phase with logarithmic frequency, one pair of axes per I/O pair. Several systems overlay with optional per-system LineSpec strings, an optional frequency vector or {wmin,wmax} range, and trailing line Name/Value pairs applied to every line. Continuous evaluation uses s=j*w; discrete evaluation uses z=exp(j*w*Ts), with w in radians per model time unit. State-space evaluation reduces A to Hessenberg form once, then solves each shifted system without inversion; Rational models use polynomial evaluation for each channel. Transport delays contribute -w*tau radians, where tau is the total delay in seconds.
Automatic frequency: 1000 logarithmic points from one decade below floor(log10(smallest pole/zero magnitude above 1e-10)) to one decade above ceil(log10(largest magnitude)); if no finite scales above 1e-10 exist use 0.01..100. Discrete scales are abs(log(z))/Ts; the upper endpoint is always exactly pi/Ts, evaluated at z=-1, and the lower endpoint is at least two decades below it. MIMO models use pole scales only. Explicit w is a strictly increasing nonnegative real vector of at most 10000 points; discrete frequencies cannot exceed pi/Ts.
Models with zero inputs or zero outputs are rejected with an error; at least one input and one output are required.
Example
G=tf(1,[1 0.4 1]); [mag,phase,w]=bode(G,logspace(-2,2,50))Example
G=tf(1,[1 1]); bode(G)Differences from MATLAB: Automatic grids and plots differ. No plot-option objects or model arrays.
These are the engine’s help pages. Each page keeps its compatibility notes. File operations are unavailable in the browser.