Facing problem in printing real pole of transfer function of a system(Control System)
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
In the program given below I fail to obtaine real pole as title in intger format if anyone know please guide me
(In Output as title of root locus I wish to print 'Root locus of,1,2.00000+-2.00000i,1' rather output obtained as 'Root locus of,1,2.00000+-2.00000i,0-1.00000e+00' i.e real pole in exponetial form is printed which should be in real niumber)
num1=[1 -1];
den1=conv([1 1],conv([1 2+2j],[1 2-2j]));
G=tf(num1,den1);
P=pole(G);
Z = zero(G);
formatSpec='%s,%i,%f+%fi,%i';
a="Root Locus of ";
b='step response of';
figure(17)
rlocus(G)
p=sprintf(formatSpec,a,Z,P/1i,P(3,1));
title(p);
2 Kommentare
Antworten (1)
Sam Chak
am 27 Jun. 2024
Hi @Arya
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1723741/image.png)
The following is what you wish to "print" out in the title in Integer format. However, please note that the title itself might be confusing, even to experts in control theory.
num = [1 -1];
den = conv([1 1],conv([1 2+2j],[1 2-2j]));
G = tf(num, den)
P = pole(G) % poles
Z = zero(G) % zeros
%% check what they
P/1i
P(3,1)
% formatting
formatSpec = '%s, %i, %.f+%.fi, %.f';
a = "Root Locus of ";
b = 'step response of';
figure(17)
rlocus(G), grid on % create root locus diagram
% check title
tit = sprintf(formatSpec, a, Z, P(1:2)/1i, -P(3,1))
title(tit);
0 Kommentare
Siehe auch
Kategorien
Mehr zu Classical Control Design finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!