The attachment is here. Thank you.
How to plot multiple output responses of transfer functions in the same figure?
97 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Ali Deniz
il 29 Nov 2021
How can I plot this state space like the graph I attached by using tf() and step() command? Thank you!

Risposta accettata
Yusuf Suer Erdem
il 29 Nov 2021
Modificato: Yusuf Suer Erdem
il 29 Nov 2021
Try these codes below please;
clc; clear; close all;
numerator = 1;
denominator = [1,1,3,1];
sys = tf(numerator,denominator);
yyaxis left
plot(step(sys));
yyaxis right
plot(impulse(sys));
Più risposte (2)
Anish Mitra
circa 2 ore fa
Spostato: Sam Chak
14 minuti fa
If the use of yyaxis is not needed, then the stepplot command can be directly used to generate the step response. Beginning in R2024b, the chart object created has a set of properties that can be modified to customize the style.
numerator = 1;
denominator = [1,1,3,1];
sys = tf(numerator,denominator);
figure(1)
sp = stepplot(sys);
Responses can be added by using hold on or the addResponse function.
denominator2 = [1 1 4 1];
sys2 = tf(numerator,denominator2);
hold on;
stepplot(sys2);
legend('sys1', 'sys2')
or
% denominator2 = [1 1 4 1];
% sys2 = tf(numerator,denominator2);
figure(2)
sp = stepplot(sys);
addResponse(sp,sys2);
legend('sys1', 'sys2')
See list of all linear analysis plots.
0 Commenti
Adem
il 7 Feb 2024
clc; clear; close all;
numerator = 1;
denominator = [1,1,3,1];
sys = tf(numerator,denominator);
yyaxis left
plot(step(sys));
yyaxis right
plot(impulse(sys));
0 Commenti
Vedere anche
Categorie
Scopri di più su Control System Toolbox in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
