File Exchange

image thumbnail

Bode plot with asymptotes

version 1.2 (3.4 KB) by

Bode plot with asymptotes

16 Ratings



View License

The function asymp() corresponds to bode(), but it also plots asymptotes for the magnitude and phase graphs. Phase asymptotes are only horizontal and vertical.
asymp() only accepts SISO transfer functions.
If the transfer function also has a time delay, the time delay is ignored
for the phase asymptotes.
asymp() may be called in two ways only, asymp(h), or asymp(h,wmin,wmax).

Comments and Ratings (21)

Nico Sjursen

Ed Sar

Ed Sar (view profile)


good work, thanks

Trond Andresen

Trond Andresen (view profile)

I am the author of this function. It works also for the counter-examples given here by other commenters.

Aim Dulay


Yngve (view profile)

The asymptotes does not work for angles in this bandstop-filter:

>> H = tf([1 0 4000.*16000],[1 4000+16000 4000.*16000])

Transfer function:
s^2 + 6.4e007
s^2 + 20000 s + 6.4e007

>> asymp (H)

(Maybe because of the sudden 180 degree phase shift at the bandstop frequency)

Other than that, the program is wonderful <3

It doesn't work with this simple test:
f11 = -1.2794;
f12 = -7.9856;
f22 = -1.2709;
F = [f11 f12;1 f22];
G = [-f12;0];
Hx = [1 0];
B22 = inv(-Hx*inv(F)*G)
sys = ss(F, G*B22, Hx,0);
step(sys), grid

You're a Geeeeeeeeeeenius
really, great m file


Robert (view profile)

i need keeps saying error at asymp at 19

Nabil al-hadawy

******* Thank you **********
This is function (asymp.m) very nice

John babs

great stuff. thanks!

Joseph Birbiglia

Very good, but there are errors with the following transfer function:

G(s) = (s^2+1)/(s*(s^2+4))

??? Error using ==> colon
Maximum variable size allowed by the program is exceeded.

Error in ==> asymp at 147
set(get(gcf, 'CurrentAxes'),'YTick',magmin:ydelta:magmax);

Trung Duong

It's work. Nice job

Trond Andresen

I am the author of asymp( ).The problem reported by Anton Cervin has now been fixed. Please tell me if problems still remain.

Anton Cervin

It does not seem to work.

>> G = (s+1)/(s*(s+10))

Transfer function:
s + 1
s^2 + 10 s

>> asymp(G)
??? Error using ==> axes
Invalid object handle.

Error in ==> asymp at 120

Zain Gurraya

Jiro Doke

A similar submission:

I would appreciate a more comprehensive help text at the top. The code is documented pretty well. There are some coding styles that could be better (i.e. the while loops). Since you are plotting the asymptotes, maybe the function could return the break frequencies and the corresponding slopes of the asymptotes. It can have the same behavior as BODE, in which if there are no output arugments, then it would create a plot, and if there are outputs, then it wouldn't create a plot.



Just editing the description a little


Fixed for compatibility with newer Matlab versions


Compatible with Matlab 2015

Fix error: A reviewer pointed out that a certain transfer function didn't work with the current version.

MATLAB Release
MATLAB 8.6 (R2015b)


MATLAB Online Live Editor Challenge

Win cash prizes and have your live script featured on our website

Learn more

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video