Using rlocus I am confused

8 views (last 30 days)
Madyson Davis
Madyson Davis on 29 Mar 2023
Answered: Paul on 29 Mar 2023
G = tf([1 1], conv([1 2 2], [1 2 5]));
rlocus(G, linspace(-8, 0, 1000), linspace(-10,10,1000))
Error using DynamicSystem/rlocus
Invalid syntax for time or frequency response command. See command help for more information.
title('Root Locus Diagram');
xlabel('Real Axis');
ylabel('Imaginary Axis');
Confused because it keeps giving me the same error and I am wondering if I need to format it differently or something

Accepted Answer

Star Strider
Star Strider on 29 Mar 2023
You appear to be overthinking it.
Try this —
G = tf([1 1], conv([1 2 2], [1 2 5]));
figure
rlocusplot(G)
grid
% title('Root Locus Diagram');
% xlabel('Real Axis');
% ylabel('Imaginary Axis');
The rlocusplot function has more options than rlocus, although it does not return the feedback gains. Use whatever of these functions you find best for your application.
.

More Answers (1)

Paul
Paul on 29 Mar 2023
Hi Madyson,
If you want to draw the root locus for a specific range of gains, then only specify a single range at a time
G = tf([1 1], conv([1 2 2], [1 2 5]));
figure
rlocus(G, linspace(-8, 0, 1000));
title('Root Locus Diagram');
xlabel('Real Axis');
ylabel('Imaginary Axis');
Or
G = tf([1 1], conv([1 2 2], [1 2 5]));
figure
rlocus(G, linspace(-10,10,1000));
title('Root Locus Diagram');
xlabel('Real Axis');
ylabel('Imaginary Axis');
Or, use rlocusplot, but as with rlocus only specify a single gain vector.

Tags

Community Treasure Hunt

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

Start Hunting!