Plotting multiple Values on one axis

7 Ansichten (letzte 30 Tage)
Tom Daly
Tom Daly am 7 Nov. 2019
Kommentiert: KALYAN ACHARJYA am 7 Nov. 2019
I need to plot a variety of numerator values for a single denominator value.
The numerator values needed are 0.1, 1, 10, 100, 1000. If possible on individual graphs for each numerator value
Given formula = k/s+a
Where num = k and den = s+a
Given K values to be (0.1, 1, 10, 100, 1000) and a (0.1, 1, 10, 100, 1000), with all k values to be plotted for each value of a
This is my best attempt at a single value for k. Is this right?
num=[0.1];
den=[1 0.1];
G=tf(num,den);
CIsys=feedback(G,1)
step(CIsys)
title('Step response of 0.1/(s+0.1)')
subplot(2,2,1),step(G),title('Step response 0.1/s+0.1')
grid on
subplot(2,2,2),impulse(G),title('Impulse Response 0.1/s+0.1')
grid on
subplot(2,2,3),pzmap(G),title('Pole-zero map 0.1/s+0.1')
grid on
subplot(2,2,4),margin(G),title('Bode Diagram 0.1/s+0.1')
grid on

Akzeptierte Antwort

KALYAN ACHARJYA
KALYAN ACHARJYA am 7 Nov. 2019
Bearbeitet: KALYAN ACHARJYA am 7 Nov. 2019
num=[0.1, 1, 10, 100, 1000];
den=[1 0.1];
for i=1:length(num)
G=tf(num(i),den);
CIsys=feedback(G,1)
step(CIsys)
title('Step response of 0.1/(s+0.1)');
step(G), hold on, title('Step response 0.1/s+0.1')
end
Do modification for all plots, I have shown one here
  2 Kommentare
Tom Daly
Tom Daly am 7 Nov. 2019
Worked perfectly thank you!
KALYAN ACHARJYA
KALYAN ACHARJYA am 7 Nov. 2019
Good to hear that, it works @Tom

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by