Control systems: Labelling multiple plots dynamically based on parameter ?
Afficher commentaires plus anciens
Hello! This is my first time using this forum. Basically I need some way to label the plots with the value of the variable 'zeta' so that my output (below)

resembles this diagram (below) in my text book (the numbers "1.5", "1.0", "0.8", etc):

The code I have used is:
s = tf('s');
Wn = 1;
for zeta = 0.1:0.1:0.9
T = Wn^2/(s^2 + 2*zeta*Wn*s + Wn^2);
step(T);
hold all
end
Réponse acceptée
Plus de réponses (1)
Here's a way to do it with a legend.
s = tf('s');
Wn = 1;
for zeta = 0.1:0.1:0.9
T = Wn^2/(s^2 + 2*zeta*Wn*s + Wn^2);
[y,t]=step(T);
plot(t,y,'DisplayName',"zeta = "+string(zeta))
hold all
end
legend
If you really want to annotate the curves themselves, check out
doc text
doc annotation
1 commentaire
Shovnik Paul
le 28 Déc 2021
Catégories
En savoir plus sur Annotations dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

