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
0 个评论
采纳的回答
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 Center 和 File Exchange 中查找有关 Line Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!