Help with create Root Locus
4 ビュー (過去 30 日間)
古いコメントを表示
Hello I need to build a function that will print a Root Locus without using the function of rlocus. this my code but I have missed something to get to the right answer.I would like if someone can fix my code or give me another code that works and create a root locus of random Transfer Function.Thanks. the code is:
clc;
s=tf('s');
k=0:0.1:20;
help pzmap
for i=1:1:length(k)
G=zpk([],[-5 2],1)
feedback(G,1)
pzmap(G)
end
hold off;
plot(real(G),imag(G))
0 件のコメント
回答 (1 件)
Sebastian Castro
2016 年 5 月 11 日
There is actually an rlocus function in Control System Toolbox.
>> rlocus(G)
If you want to do all the work yourself for some other reason:
k=0:0.1:20;
for idx = 1:numel(k)
closedLoop = feedback(G,k(idx));
p(:,idx) = pole(closedLoop);
end
figure
hold on
plot(real(p'),imag(p'))
- Sebastian
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Classical Control Design についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!