How to draw a tangent line on a step response diagram
82 次查看(过去 30 天)
显示 更早的评论
![微信截图_20191128012715.png](https://www.mathworks.com/matlabcentral/answers/uploaded_files/250939/%E5%BE%AE%E4%BF%A1%E6%88%AA%E5%9B%BE_20191128012715.png)
When I get the step response by sisotool like pic 1m how can I get the tangent line and the value of L, T in pic 2?
回答(1 个)
Samatha Aleti
2020-1-29
You can draw a tangent to a step response curve at a particular point as follows:
sys = tf([8 18 32],[1 6 14 24]); % Transfer function
[y,t] = step(sys); % Step response
plot(t,y);
hold on
slope = diff(y)./diff(t);
k = 100; % To draw tangent at (100)th point
yTangent = (t-t(k))*slope(k)+y(k); % Equation of tangent
plot(t,yTangent);
scatter(t(k),yTangent(k));
hold off
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Dynamic System Models 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!