Plotting multiple Values on one axis

2 次查看(过去 30 天)
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

采纳的回答

KALYAN ACHARJYA
KALYAN ACHARJYA 2019-11-7
编辑:KALYAN ACHARJYA 2019-11-7
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

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Line Plots 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by