Electrical Engineering Stack Exchange is a question and answer site for electronics and electrical engineering professionals, students, and enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've got the next transfer function:

$$ \frac{\hat{\alpha}}{\hat{\alpha_{ref}}} =\frac{w_n^2}{s^2+2w_n \xi s+ w_n^2} $$

Now I want to draw a step response input at height of \$\alpha_{ref}\$, where \$\xi\$ comes with differing values (i.e different graphs on the same axis for different values of \$\xi\$, and the value of \$w_n\$ depends on \$\xi\$).

How to implement this in Matlab?

Thanks in advance.

share|improve this question
up vote 3 down vote accepted

A not-at-all elegant way to do it is:

zeta=[...]; %your zeta values
wn = ... % calculate your wn values according to your zeta values
for idx = 1:length(zeta)
    % sys = tf([wn(idx)],[1 2*wn(idx)*zeta(idx) wn(idx)^2]); %system's transfer function
    % EDIT : numerator corrected
    sys = tf([wn(idx)^2],[1 2*wn(idx)*zeta(idx) wn(idx)^2]); %system's transfer function
share|improve this answer
Thanks it should the numerator \$wn(idx)^2\$, other than that looks ok to me. – MathematicalPhysicist Nov 18 '12 at 2:57
I haven't noticed that. Thanks for pointing it out. Edited my answer accordingly. – HebeleHododo Nov 18 '12 at 11:13
You can write hold on instead of hold('on'); – Szymon Bęczkowski Nov 18 '12 at 13:39
Well yeah, but I usually try to use the function syntax. I think it gives the code more consistency. Syntax documentation can be found here: mathworks.com/help/matlab/ref/syntax.html mathworks.com/help/matlab/matlab_prog/… – HebeleHododo Nov 19 '12 at 6:26

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.